summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/class
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/expressions/class
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/expressions/class')
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-in.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-yield-expr.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-evaluation.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-to-prop-key.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-unresolvable.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/computed.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-binary.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-exponent.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-hex.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-leading-decimal.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-non-canonical.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-octal.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-zero.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-char-escape.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped-ext.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-double-quote.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-empty.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-hex-escape.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-line-continuation.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-single-quote.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-unicode-escape.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-inst/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static-computed-in.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static-computed-yield-expr.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-evaluation.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-to-prop-key.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-unresolvable.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/computed.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-binary.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-exponent.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-hex.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-leading-decimal.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-non-canonical.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-octal.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-zero.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-char-escape.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped-ext.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-double-quote.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-empty.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-hex-escape.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-line-continuation.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-single-quote.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-unicode-escape.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/accessor-name-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js226
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js242
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js250
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js229
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js204
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js210
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/array-destructuring-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-abrupt.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-not-undefined.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-undefined.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-duplicates.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-later.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-prior.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-self.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-rest.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-trailing-comma.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-caller.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-prop-caller.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/object-destructuring-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-multiple.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-single.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/rest-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/rest-params-trailing-comma-early-error.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-spread-strict-strict.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-strict-strict.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-catch.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-async-iterator.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-sync-iterator.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-async-iterator.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-sync-iterator.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-multiple.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-single.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-obj.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-next.js226
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-return.js242
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-throw.js250
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-expr-abrupt.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-get-abrupt.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-boolean-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-number-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-object-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-string-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-symbol-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-null-sync-get-abrupt.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-abrupt.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-boolean-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-null-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-number-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-string-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-symbol-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-undefined-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-undefined-sync-get-abrupt.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-get-abrupt.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-boolean-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-number-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-object-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-string-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-symbol-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-abrupt.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-boolean-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-null-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-number-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-string-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-symbol-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-undefined-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-done-get-abrupt.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-returns-abrupt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-value-get-abrupt.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-get-abrupt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-non-object-ignores-then.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-boolean-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-null-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-number-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-object-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-string-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-symbol-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-undefined-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-get-abrupt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-null-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-number-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-object-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-string-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-returns-abrupt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-next.js229
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-return.js204
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-throw.js210
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/array-destructuring-param-strict-body.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-abrupt.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-not-undefined.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-undefined.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-duplicates.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-later.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-prior.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-self.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-rest.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-trailing-comma.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-arguments.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-caller.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-prop-caller.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/object-destructuring-param-strict-body.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-multiple.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-single.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/rest-param-strict-body.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/rest-params-trailing-comma-early-error.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-arguments-from-parent-function.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-newtarget.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-arguments-from-own-function.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-newtarget.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/array-destructuring-param-strict-body.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier-escaped.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference-escaped.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier-escaped.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-abrupt.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-not-undefined.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-undefined.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-duplicates.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-later.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-prior.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-self.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-rest.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/dflt-params-trailing-comma.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-arguments.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-caller.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-get.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-value.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-prop-caller.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/object-destructuring-param-strict-body.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-multiple.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-single.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/rest-param-strict-body.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/rest-params-trailing-comma-early-error.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-arguments-from-parent-function.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-newtarget.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-arguments-from-own-function.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-newtarget.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/returns-async-function.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/async-method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped-module.js24
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped.js19
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-await-module.js23
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-await.js18
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-let-escaped.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-let.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-static-escaped.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-static.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-yield-escaped.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/class-name-ident-yield.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/constructor-this-tdz-during-initializers.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-add.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-subtract.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-arrow-function-expression.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-assignment.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-bitwise-or.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-coalesce.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-and.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-or.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-async-arrow-function-expression.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-false.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-true.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-e-notational-literal.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-literal.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-exponetiation-expression.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-coalesce.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-and.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-or.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-declaration.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-expression.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-generator-function-declaration.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-identifier.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-e-notational-literal.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-separators.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-math.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-div.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-mult.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-null.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-numeric-literal.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-string-literal.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-yield-expression.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-add.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-subtract.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-arrow-function-expression.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-assignment.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-bitwise-or.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-coalesce.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-and.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-or.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-async-arrow-function-expression.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-false.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-true.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-e-notational-literal.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-literal.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-exponetiation-expression.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-coalesce.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-and.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-or.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-declaration.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-expression.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-generator-function-declaration.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-identifier.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-e-notational-literal.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-separators.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-math.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-div.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-mult.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-null.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-numeric-literal.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-string-literal.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-yield-expression.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-add.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-subtract.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-arrow-function-expression.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-assignment.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-bitwise-or.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-coalesce.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-and.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-or.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-async-arrow-function-expression.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-false.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-true.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-e-notational-literal.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-literal.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-exponetiation-expression.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-coalesce.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-and.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-or.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-declaration.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-expression.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-generator-function-declaration.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-identifier.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-e-notational-literal.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-separators.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-math.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-div.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-mult.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-null.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-numeric-literal.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-string-literal.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-yield-expression.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-add.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-subtract.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-arrow-function-expression.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-assignment.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-coalesce.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-and.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-or.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-async-arrow-function-expression.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-false.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-true.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-e-notational-literal.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-literal.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-exponetiation-expression.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-coalesce.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-and.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-or.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-declaration.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-expression.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-generator-function-declaration.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-identifier.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-e-notational-literal.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-separators.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-math.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-div.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-mult.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-null.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-numeric-literal.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-string-literal.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-yield-expression.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/decorator-member-expr-private-identifier.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js60
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/decorator/syntax/valid/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-no-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-name-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-null.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-undefined.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-null.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-undefined.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-empty.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-list-err.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-name-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-null.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-null.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-undefined.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-empty.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-name-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-empty.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-step-err.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-null.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-undefined.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-null.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-undefined.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-throws.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-list-err.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-null.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-undefined.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-null.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-undefined.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-list-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err-array-prototype.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-no-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-name-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-val-null.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-hole.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-undef.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-done.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-null.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-step-err.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elem.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elision.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-empty.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-rest.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-direct.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-exhausted.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-no-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-name-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-null.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-undefined.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-list-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-getter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-null.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-undefined.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-get-value-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-list-err.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-value-null.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-eval-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-throws.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-null.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-getter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-val-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-no-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-name-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-step-err.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-direct.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-no-close.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-name-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-empty.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-undefined.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-list-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-null.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-undefined.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-empty.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-get-value-err.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-skipped.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-throws.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-list-err.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-eval-err.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-init.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-getter.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-val-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-no-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-name-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-empty.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-empty.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-name-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-empty.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-empty.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-no-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-name-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision-exhausted.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-direct.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-elision.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-no-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-name-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-getter.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-val-obj.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-no-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-name-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-name-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-empty.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-getter.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/dstr/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-names.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-symbol-names.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names-asi.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-field-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-getter-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-names.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier-initializer.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-alt.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer-alt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-fields.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods-with-fields.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-string-literal-names.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-names.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-symbol-names.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names-asi.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-field-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-getter-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-names.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier-initializer.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-alt.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer-alt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-fields.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods-with-fields.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-method-string-literal-names.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-names.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-symbol-names.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names-asi.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-field-usage.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-getter-usage.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-usage.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-names.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier-initializer.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter-alt.js144
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter.js144
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method-alt.js143
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method.js143
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter-alt.js143
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter.js143
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js151
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js152
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js151
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js152
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js141
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-fields.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods-with-fields.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-string-literal-names.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-names.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-symbol-names.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names-asi.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-field-usage.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-getter-usage.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-usage.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-names.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier-initializer.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter-alt.js143
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter.js143
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method-alt.js142
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method.js142
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter-alt.js142
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter.js142
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-alt.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js118
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer.js118
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js150
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js151
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js150
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js151
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js139
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-fields.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods-with-fields.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-string-literal-names.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-names.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-symbol-names.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names-asi.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-field-usage.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-getter-usage.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-usage.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-names.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier-initializer.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter-alt.js131
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter.js131
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method-alt.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter-alt.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-alt.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-fields.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods-with-fields.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-string-literal-names.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-names.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-symbol-names.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names-asi.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-field-usage.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-getter-usage.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-usage.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-names.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier-initializer.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter-alt.js131
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter.js131
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method-alt.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter-alt.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-alt.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer-alt.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-by-classname.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-fields.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods-with-fields.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-string-literal-names.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-2.js29
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-newtarget.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-indirect-eval-err-contains-newtarget.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-1.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-2.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-2.js29
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-newtarget.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-body-private-indirect-eval-err-contains-newtarget.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-spread-strict-strict.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-strict-strict.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-catch.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-async-iterator.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-async-iterator.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-sync-iterator.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-multiple.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-single.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-obj.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-next.js247
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-return.js263
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-throw.js271
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-expr-abrupt.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-get-abrupt.js102
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-boolean-throw.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-number-throw.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-object-throw.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-string-throw.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-symbol-throw.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-null-sync-get-abrupt.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-abrupt.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-boolean-throw.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-null-throw.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-number-throw.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-string-throw.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-symbol-throw.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-undefined-throw.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-get-abrupt.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-number-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-object-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-string-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-abrupt.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-boolean-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-null-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-number-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-string-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-symbol-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-undefined-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-done-get-abrupt.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-returns-abrupt.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-value-get-abrupt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-get-abrupt.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-non-object-ignores-then.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-boolean-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-null-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-number-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-object-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-string-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-symbol-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-undefined-throw.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-get-abrupt.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-returns-abrupt.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-next.js250
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-return.js225
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-throw.js231
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-spread-strict-strict.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-strict-strict.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-catch.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-async-iterator.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-sync-iterator.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-async-iterator.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-sync-iterator.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-multiple.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-single.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-obj.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-next.js257
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-return.js273
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-throw.js281
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-expr-abrupt.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-get-abrupt.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-boolean-throw.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-number-throw.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-object-throw.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-string-throw.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-symbol-throw.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-null-sync-get-abrupt.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-abrupt.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-boolean-throw.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-null-throw.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-number-throw.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-string-throw.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-symbol-throw.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-undefined-throw.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-undefined-sync-get-abrupt.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-get-abrupt.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-boolean-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-number-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-object-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-string-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-symbol-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-abrupt.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-boolean-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-null-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-number-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-string-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-symbol-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-undefined-throw.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-done-get-abrupt.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-returns-abrupt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-value-get-abrupt.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-get-abrupt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-non-object-ignores-then.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-boolean-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-null-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-number-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-object-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-string-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-symbol-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-undefined-throw.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-get-abrupt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-null-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-number-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-object-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-string-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-returns-abrupt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-next.js260
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-return.js235
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-throw.js241
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier-escaped.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-newtarget.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-arguments-from-own-function.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-newtarget.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/async-private-method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-anonymous.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-decl.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-default-export.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-expr.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-arguments.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-super.js29
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive-symbol.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/ctor-called-after-fields-init.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-2.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-newtarget.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-referenceerror.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-err.js60
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-noncallable.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-nonobject.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-tostring-err.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-valueof-err.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/evaluation-error/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/field-declaration.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/field-definition-accessor-no-line-terminator.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-anonymous-function-length.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-1.js21
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-2.js19
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-3.js19
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-4.js19
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-5.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-1.js18
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-2.js18
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-computed-name-static-propname-prototype.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-duplicate-privatenames.js25
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-literal-name-propname-constructor.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-constructor.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-prototype.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-multiple-definitions-static-private-methods-proxy.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-run-once-on-double-super.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-string-name-propname-constructor.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-constructor.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-prototype.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-spread-strict-strict.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-strict-strict.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-multiple.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-single.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-obj.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-spread-strict-strict.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-strict-strict.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-multiple.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-single.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-obj.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/grammar-private-field-optional-chaining.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/indirect-eval-contains-arguments.js24
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/indirect-eval-err-contains-newtarget.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/init-err-evaluation.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/init-value-defined-after-class.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/init-value-incremental.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/intercalated-static-non-static-computed-fields.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-names.js158
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-symbol-names.js156
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js160
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names-asi.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names.js147
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-field-usage.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-getter-usage.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-usage.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-names.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier-initializer.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier.js145
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter-alt.js179
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter.js179
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method-alt.js178
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method.js178
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter-alt.js178
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter.js178
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-alt.js160
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer-alt.js154
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer.js154
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier.js160
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js185
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier.js186
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier-alt.js185
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier.js186
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js175
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier.js176
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier-alt.js173
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier.js173
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js161
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt.js161
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-by-classname.js161
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier.js161
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-fields.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods-with-fields.js139
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-definitions-string-literal-names.js160
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-names.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-symbol-names.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js132
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names-asi.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-field-usage.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-getter-usage.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-usage.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-names.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier-initializer.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter-alt.js151
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter.js151
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method-alt.js150
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method.js150
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter-alt.js150
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter.js150
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-alt.js132
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier.js132
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js157
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js158
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js157
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js158
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js147
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js148
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js145
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier.js145
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js133
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt.js133
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js133
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier.js133
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-fields.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods-with-fields.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-string-literal-names.js132
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-arguments.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-super.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-2.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-arguments.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-newtarget.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-contains-arguments.js23
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-err-contains-newtarget.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-arguments.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-super.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-2.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-arguments.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-newtarget.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-contains-arguments.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-err-contains-newtarget.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-arguments.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-super.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-names.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-symbol-names.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names-asi.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-field-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-getter-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-names.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier-initializer.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter-alt.js129
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter.js129
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-fields.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods-with-fields.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-string-literal-names.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-names.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-symbol-names.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names-asi.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-field-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-getter-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-names.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier-initializer.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter-alt.js129
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter.js129
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier-alt.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-by-classname.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-fields.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods-with-fields.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-string-literal-names.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-names.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-symbol-names.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names-asi.js78
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-field-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-getter-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-usage.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-names.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier-initializer.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter-alt.js129
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter.js129
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier.js126
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier-alt.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-by-classname.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-fields.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods-with-fields.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-string-literal-names.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWNJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u2118.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u6F.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWNJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-common.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-dollar.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-u2118.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-underscore.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWNJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u2118.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u6F.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWNJ.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-common.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-dollar.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-u2118.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-underscore.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-async-generator-method-name.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-async-method-name.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-1.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-2.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-2.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-1.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-2.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-newtarget.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-arrow-function.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-after-optional-chain.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-as-arrow-function.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-as-async-arrow-function.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-as-async-function.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-as-function.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-field-on-nested-class.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-fields-proxy-default-handler-throws.js32
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-generator-method-name.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-arrow-function.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-is-not-a-own-property.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-on-nested-class.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-field-on-nested-class.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-getter-on-nested-class.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-method-on-nested-class.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-setter-on-nested-class.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-contains-arguments.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-err-contains-newtarget.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-arrow-function.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-comparison.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-get-and-call.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-is-not-a-own-property.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-length.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-on-nested-class.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-referenced-from-static-method.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-field-on-nested-class.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-getter-on-nested-class.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-setter-on-nested-class.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-on-nested-class.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-generator.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-method.js130
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-generator.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js142
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-methods/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-arrow-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-function.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-is-not-a-own-property.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-on-nested-class.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-field-on-nested-class.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-getter-on-nested-class.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-method-on-nested-class.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-setter-on-nested-class.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-async-generator-method-name.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-async-method-name.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-field-on-nested-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-getter-on-nested-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-method-on-nested-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-setter-on-nested-class.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-field-usage-inside-nested-class.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-generator-method-name.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-length.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-name.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-field-on-nested-class.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-getter-on-nested-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-method-on-nested-class.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-setter-on-nested-class.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-static-method-usage-inside-nested-class.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-constructor.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-field-initializer.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-constructor.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-field-initializer.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-constructor.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-field-initializer.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/redeclaration-symbol.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/redeclaration.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-names.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-symbol-names.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names-asi.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-field-usage.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-getter-usage.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-usage.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-names.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier-initializer.js73
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter-alt.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method-alt.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter-alt.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-alt.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer-alt.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier.js95
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier-alt.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier.js111
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier-alt.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt-by-classname.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-by-classname.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-fields.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods-with-fields.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/regular-definitions-string-literal-names.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-names.js120
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-symbol-names.js118
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names-asi.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-field-usage.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-getter-usage.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-usage.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-names.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier-initializer.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter-alt.js141
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter.js141
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method-alt.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter-alt.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer-alt.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js148
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js149
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js148
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier.js149
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier-alt.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-by-classname.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-fields.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods-with-fields.js101
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-string-literal-names.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-names.js119
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-symbol-names.js117
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names-asi.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-field-usage.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-getter-usage.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-usage.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-names.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier-initializer.js99
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier.js106
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter-alt.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter.js140
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method-alt.js139
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method.js139
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter-alt.js139
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter.js139
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-alt.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer-alt.js115
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer.js115
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js147
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier.js148
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier-alt.js147
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier.js148
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js136
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier.js137
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-by-classname.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-fields.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods-with-fields.js100
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-async-method-string-literal-names.js121
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-names.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-symbol-names.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names-asi.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-field-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-getter-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-names.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier-initializer.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-alt.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer-alt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier-alt.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-fields.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods-with-fields.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-gen-string-literal-names.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-names.js107
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-symbol-names.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-grammar-privatename-identifier-semantics-stringvalue.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names-asi.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-private-field-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-getter-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-usage.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-private-names.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier-initializer.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter-alt.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter.js128
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter-alt.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter.js127
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-alt.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer-alt.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer.js103
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier-alt.js134
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier.js135
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier-alt.js124
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier.js125
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-by-classname.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer.js104
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-fields.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods-with-fields.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/same-line-method-string-literal-names.js109
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field-assigned.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field-assigned.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-arguments.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-super.js29
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-length.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-name.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-field-declaration.js132
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-field-init-this-inside-arrow-function.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-field-init-with-this.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-field-redeclaration.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-fields-proxy-default-handler-throws.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-arrow-function.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-class.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-function.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-getter.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-arrow-function.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-function.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-method-and-instance-method-brand-check.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-method-referenced-from-instance-method.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-method-subclass-receiver.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-methods-proxy-default-handler-throws.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-arrow-function.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-class.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-function.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-private-setter.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/super-access-from-arrow-func-on-field.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js44
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js43
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js42
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js47
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-fields-same-line-error.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-super-access.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-constructor.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-error.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-prototype.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-bad-reference.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-this.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-bad-reference.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-this.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-field-cannot-escape-token.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-method-cannot-escape-token.js26
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js24
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-accessor.js27
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier-alt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-fields-multi-line.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js23
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-identifier.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatenames-multi-line.js34
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js32
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js22
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js22
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js22
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-meth-prototype.js22
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/syntax/valid/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-arguments.js35
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-super.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-names.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-symbol-names.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names-asi.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-field-usage.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-getter-usage.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-usage.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-names.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier-initializer.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter-alt.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter.js116
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method-alt.js115
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method.js115
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter-alt.js115
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter.js115
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-alt.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer-alt.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer.js91
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js122
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier.js123
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js112
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier.js113
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier-alt.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-by-classname.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-fields.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods-with-fields.js76
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-string-literal-names.js98
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-length-dflt.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-param-dflt-yield.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/array-destructuring-param-strict-body.js159
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-abrupt.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-not-undefined.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-undefined.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-duplicates.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-later.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-prior.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-self.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-rest.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-trailing-comma.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-caller.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/object-destructuring-param-strict-body.js159
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-multiple.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-single.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/rest-param-strict-body.js159
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/rest-params-trailing-comma-early-error.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-spread-strict-strict.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-strict-strict.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-multiple.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-single.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-obj.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/array-destructuring-param-strict-body.js159
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-abrupt.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-not-undefined.js114
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-undefined.js97
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-duplicates.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-later.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-prior.js94
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-self.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-rest.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/dflt-params-trailing-comma.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-arguments.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-caller.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-prop-caller.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/object-destructuring-param-strict-body.js159
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-multiple.js89
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-single.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/rest-param-strict-body.js159
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/rest-params-trailing-comma-early-error.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier-escaped.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier.js36
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-spread-strict-strict.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-strict-strict.js45
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-multiple.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-single.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/gen-method/yield-spread-obj.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/getter-param-dflt.js24
-rw-r--r--js/src/tests/test262/language/expressions/class/heritage-arrow-function.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/heritage-async-arrow-function.js33
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-break-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-case-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-catch-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-class-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-const-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-continue-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-debugger-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped-ext.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-default.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-delete-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-do-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-else-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-enum-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-export-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped-ext.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-extends.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-finally-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-for-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-function-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-if-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-implements-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-import-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-in-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-instanceof-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-interface-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-let-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-new-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-package-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-private-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-protected-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-public-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-return-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-static-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-super-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-switch-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-this-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-throw-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-try-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-typeof-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-var-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-void-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-while-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/ident-name-method-def-with-escaped.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/method-length-dflt.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/method-param-dflt-yield.js23
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/array-destructuring-param-strict-body.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-abrupt.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-not-undefined.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-undefined.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-duplicates.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-later.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-prior.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-self.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-rest.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/dflt-params-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-arguments.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-caller.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-prop-caller.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/object-destructuring-param-strict-body.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-multiple.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-single.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/rest-param-strict-body.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/rest-params-trailing-comma-early-error.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/array-destructuring-param-strict-body.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/method/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-abrupt.js85
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-not-undefined.js110
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-undefined.js93
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-duplicates.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-ref-later.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-ref-prior.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-ref-self.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-rest.js88
-rw-r--r--js/src/tests/test262/language/expressions/class/method/dflt-params-trailing-comma.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-arguments.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-caller.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-get.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-value.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-prop-caller.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/method/object-destructuring-param-strict-body.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/method/params-trailing-comma-multiple.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/method/params-trailing-comma-single.js83
-rw-r--r--js/src/tests/test262/language/expressions/class/method/rest-param-strict-body.js155
-rw-r--r--js/src/tests/test262/language/expressions/class/method/rest-params-trailing-comma-early-error.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/method/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/name.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-args-unmapped.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-ref-arguments.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-args-unmapped.js108
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-ref-arguments.js87
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-meth-args-unmapped.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-meth-ref-arguments.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-meth-static-args-unmapped.js105
-rw-r--r--js/src/tests/test262/language/expressions/class/params-dflt-meth-static-ref-arguments.js84
-rw-r--r--js/src/tests/test262/language/expressions/class/poisoned-underscore-proto.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval-indirect.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-factory.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-function-ctor.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval-indirect.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-factory.js48
-rw-r--r--js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-function-ctor.js52
-rw-r--r--js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm-function-ctor.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval-indirect.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-factory.js50
-rw-r--r--js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-function-ctor.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-direct-eval.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-eval-indirect.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-factory.js65
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-function-ctor.js70
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-realm.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-direct-eval.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-eval-indirect.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-factory.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-function-ctor.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-realm.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-direct-eval.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-eval-indirect.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-factory.js49
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-function-ctor.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-realm.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-direct-eval.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-eval-indirect.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-factory.js53
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-function-ctor.js58
-rw-r--r--js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-realm.js63
-rw-r--r--js/src/tests/test262/language/expressions/class/restricted-properties.js62
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-close.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-open.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-close.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-open.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-name-lex-close.js23
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-name-lex-open-heritage.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-name-lex-open-no-heritage.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-close.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-open.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-close.js40
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-open.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-close.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-open.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-close.js39
-rw-r--r--js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-open.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/setter-length-dflt.js41
-rw-r--r--js/src/tests/test262/language/expressions/class/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/static-gen-method-param-dflt-yield.js28
-rw-r--r--js/src/tests/test262/language/expressions/class/static-init-await-binding.js24
-rw-r--r--js/src/tests/test262/language/expressions/class/static-init-await-reference.js30
-rw-r--r--js/src/tests/test262/language/expressions/class/static-method-length-dflt.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/static-method-param-dflt-yield.js23
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-AggregateError.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Array.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ArrayBuffer.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigInt64Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigUint64Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Boolean.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-DataView.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Date.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Error.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-EvalError.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float32Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float64Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Function.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int16Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int32Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int8Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Map.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Number.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Object.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Promise.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RangeError.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ReferenceError.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RegExp.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Set.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SharedArrayBuffer.js18
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-String.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SyntaxError.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-TypeError.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-URIError.js16
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint16Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint32Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8Array.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8ClampedArray.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakMap.js17
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakRef.js18
-rw-r--r--js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakSet.js17
4171 files changed, 328534 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-in.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-in.js
new file mode 100644
index 0000000000..1d482fbc9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-in.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+es6id: 14.5.14
+description: >
+ AssignmentExpression may contain `in` keyword regardless of outer context
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var empty = Object.create(null);
+var C, value;
+
+for (C = class { get ['x' in empty]() { return 'via get'; } }; ; ) {
+ value = C.prototype.false;
+ break;
+}
+
+assert.sameValue(value, 'via get');
+
+for (C = class { set ['x' in empty](param) { value = param; } }; ; ) {
+ C.prototype.false = 'via set';
+ break;
+}
+
+assert.sameValue(value, 'via set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-yield-expr.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-yield-expr.js
new file mode 100644
index 0000000000..f0eb25c066
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst-computed-yield-expr.js
@@ -0,0 +1,43 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-object-initializer-runtime-semantics-evaluation
+es6id: 12.2.6.8
+description: >
+ The `yield` keyword behaves as a YieldExpression within a generator function
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+features: [generators]
+---*/
+
+var yieldSet, C, iter;
+function* g() {
+ C = class {
+ get [yield]() { return 'get yield'; }
+ set [yield](param) { yieldSet = param; }
+ };
+}
+
+iter = g();
+
+iter.next();
+iter.next('first');
+iter.next('second');
+
+assert.sameValue(C.prototype.first, 'get yield');
+
+C.prototype.second = 'set yield';
+
+assert.sameValue(yieldSet, 'set yield');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/browser.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-evaluation.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-evaluation.js
new file mode 100644
index 0000000000..a5c92a62db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-evaluation.js
@@ -0,0 +1,41 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed-err-evaluation.case
+// - src/accessor-names/error/cls-expr-inst.template
+/*---
+description: Abrupt completion when evaluating expression (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+---*/
+var thrower = function() {
+ throw new Test262Error();
+};
+
+
+assert.throws(Test262Error, function() {
+ 0, class {
+ get [thrower()]() {}
+ };
+}, '`get` accessor');
+
+assert.throws(Test262Error, function() {
+ 0, class {
+ set [thrower()](_) {}
+ };
+}, '`set` accessor');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-to-prop-key.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-to-prop-key.js
new file mode 100644
index 0000000000..c9ccf2ef2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-to-prop-key.js
@@ -0,0 +1,57 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed-err-to-prop-key.case
+// - src/accessor-names/error/cls-expr-inst.template
+/*---
+description: Abrupt completion when coercing to property key value (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+ 7.1.14 ToPropertyKey
+
+ 1. Let key be ? ToPrimitive(argument, hint String).
+
+ 7.1.1 ToPrimitive
+
+ [...]
+ 7. Return ? OrdinaryToPrimitive(input, hint).
+
+ 7.1.1.1 OrdinaryToPrimitive
+
+ 5. For each name in methodNames in List order, do
+ [...]
+ 6. Throw a TypeError exception.
+---*/
+var badKey = Object.create(null);
+
+
+assert.throws(TypeError, function() {
+ 0, class {
+ get [badKey]() {}
+ };
+}, '`get` accessor');
+
+assert.throws(TypeError, function() {
+ 0, class {
+ set [badKey](_) {}
+ };
+}, '`set` accessor');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-unresolvable.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-unresolvable.js
new file mode 100644
index 0000000000..e9666db9a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed-err-unresolvable.js
@@ -0,0 +1,39 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed-err-unresolvable.case
+// - src/accessor-names/error/cls-expr-inst.template
+/*---
+description: Abrupt completion when resolving reference value (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+---*/
+
+assert.throws(ReferenceError, function() {
+ 0, class {
+ get [test262unresolvable]() {}
+ };
+}, '`get` accessor');
+
+assert.throws(ReferenceError, function() {
+ 0, class {
+ set [test262unresolvable](_) {}
+ };
+}, '`set` accessor');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed.js
new file mode 100644
index 0000000000..84f5de3e68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/computed.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (AssignmentExpression) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+var _;
+
+
+var stringSet;
+
+var C = class {
+ get [_ = 'str' + 'ing']() { return 'get string'; }
+ set [_ = 'str' + 'ing'](param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['string'], 'get string');
+
+C.prototype['string'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-binary.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-binary.js
new file mode 100644
index 0000000000..837494e06e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-binary.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-binary.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal in binary notation) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 0b10() { return 'get string'; }
+ set 0b10(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['2'], 'get string');
+
+C.prototype['2'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-exponent.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-exponent.js
new file mode 100644
index 0000000000..0196f964f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-exponent.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-exponent.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal in exponent notation) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 1E+9() { return 'get string'; }
+ set 1E+9(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['1000000000'], 'get string');
+
+C.prototype['1000000000'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-hex.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-hex.js
new file mode 100644
index 0000000000..1a41d78eb7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-hex.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-hex.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal in hexadecimal notation) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 0x10() { return 'get string'; }
+ set 0x10(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['16'], 'get string');
+
+C.prototype['16'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-leading-decimal.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-leading-decimal.js
new file mode 100644
index 0000000000..d43f586e60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-leading-decimal.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-leading-decimal.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal with leading decimal point) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get .1() { return 'get string'; }
+ set .1(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['0.1'], 'get string');
+
+C.prototype['0.1'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-non-canonical.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-non-canonical.js
new file mode 100644
index 0000000000..4ea405007c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-non-canonical.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-non-canonical.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal with non-canonical representation) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 0.0000001() { return 'get string'; }
+ set 0.0000001(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['1e-7'], 'get string');
+
+C.prototype['1e-7'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-octal.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-octal.js
new file mode 100644
index 0000000000..dca95a346b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-octal.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-octal.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal in octal notation) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 0o10() { return 'get string'; }
+ set 0o10(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['8'], 'get string');
+
+C.prototype['8'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-zero.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-zero.js
new file mode 100644
index 0000000000..36c157b521
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-numeric-zero.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-zero.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (numeric literal zero) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 0() { return 'get string'; }
+ set 0(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['0'], 'get string');
+
+C.prototype['0'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-char-escape.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-char-escape.js
new file mode 100644
index 0000000000..db660915bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-char-escape.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-char-escape.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal containing a character escape sequence) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'character\tescape'() { return 'get string'; }
+ set 'character\tescape'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['character escape'], 'get string');
+
+C.prototype['character escape'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped-ext.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped-ext.js
new file mode 100644
index 0000000000..453676688d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped-ext.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-default-escaped-ext.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal 'default' w/ extended escape) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'def\u{61}ult'() { return 'get string'; }
+ set 'def\u{61}ult'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['default'], 'get string');
+
+C.prototype['default'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped.js
new file mode 100644
index 0000000000..bb01927558
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default-escaped.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-default-escaped.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal 'default' escaped) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'def\u0061ult'() { return 'get string'; }
+ set 'def\u0061ult'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['default'], 'get string');
+
+C.prototype['default'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default.js
new file mode 100644
index 0000000000..aac5cbfa61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-default.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-default.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal 'default') (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'default'() { return 'get string'; }
+ set 'default'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['default'], 'get string');
+
+C.prototype['default'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-double-quote.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-double-quote.js
new file mode 100644
index 0000000000..08de7faca5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-double-quote.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-double-quote.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal using double quotes) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get "doubleQuote"() { return 'get string'; }
+ set "doubleQuote"(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype["doubleQuote"], 'get string');
+
+C.prototype["doubleQuote"] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-empty.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-empty.js
new file mode 100644
index 0000000000..3175f424b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-empty.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-empty.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal, the empty string) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get ''() { return 'get string'; }
+ set ''(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype[''], 'get string');
+
+C.prototype[''] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-hex-escape.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-hex-escape.js
new file mode 100644
index 0000000000..ee2668caaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-hex-escape.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-hex-escape.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal containing a hexadecimal escape sequence) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'hex\x45scape'() { return 'get string'; }
+ set 'hex\x45scape'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['hexEscape'], 'get string');
+
+C.prototype['hexEscape'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-line-continuation.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-line-continuation.js
new file mode 100644
index 0000000000..ce0813bade
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-line-continuation.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-line-continuation.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal containing LineContinuation) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'line\
+Continuation'() { return 'get string'; }
+ set 'line\
+Continuation'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['lineContinuation'], 'get string');
+
+C.prototype['lineContinuation'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-single-quote.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-single-quote.js
new file mode 100644
index 0000000000..6fdd147d90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-single-quote.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-single-quote.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal using single quotes) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'singleQuote'() { return 'get string'; }
+ set 'singleQuote'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['singleQuote'], 'get string');
+
+C.prototype['singleQuote'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-unicode-escape.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-unicode-escape.js
new file mode 100644
index 0000000000..21a232d122
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/literal-string-unicode-escape.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-unicode-escape.case
+// - src/accessor-names/default/cls-expr-inst.template
+/*---
+description: Computed values as accessor property names (string literal containing a Unicode escape sequence) (Class expression, instance method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments proto and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ get 'unicod\u{000065}Escape'() { return 'get string'; }
+ set 'unicod\u{000065}Escape'(param) { stringSet = param; }
+};
+
+assert.sameValue(C.prototype['unicodeEscape'], 'get string');
+
+C.prototype['unicodeEscape'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-inst/shell.js b/js/src/tests/test262/language/expressions/class/accessor-name-inst/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-inst/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static-computed-in.js b/js/src/tests/test262/language/expressions/class/accessor-name-static-computed-in.js
new file mode 100644
index 0000000000..445fb6ddf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static-computed-in.js
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+es6id: 14.5.14
+description: >
+ AssignmentExpression may contain `in` keyword regardless of outer context
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var empty = Object.create(null);
+var C, value;
+
+for (C = class { static get ['x' in empty]() { return 'via get'; } }; ; ) {
+ value = C.false;
+ break;
+}
+
+assert.sameValue(value, 'via get');
+
+for (C = class { static set ['x' in empty](param) { value = param; } }; ; ) {
+ C.false = 'via set';
+ break;
+}
+
+assert.sameValue(value, 'via set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static-computed-yield-expr.js b/js/src/tests/test262/language/expressions/class/accessor-name-static-computed-yield-expr.js
new file mode 100644
index 0000000000..b6e45a59a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static-computed-yield-expr.js
@@ -0,0 +1,45 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-object-initializer-runtime-semantics-evaluation
+es6id: 12.2.6.8
+description: >
+ The `yield` keyword behaves as a YieldExpression within a generator function
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+features: [generators]
+---*/
+
+var yieldSet, C, iter;
+function* g() {
+ C = class {
+ static get [yield]() { return 'get yield'; }
+ static set [yield](param) { yieldSet = param; }
+ };
+}
+
+iter = g();
+
+iter.next();
+iter.next('first');
+iter.next('second');
+
+assert.sameValue(C.first, 'get yield');
+
+C.second = 'set yield';
+
+assert.sameValue(yieldSet, 'set yield');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/browser.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-evaluation.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-evaluation.js
new file mode 100644
index 0000000000..670eca7bb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-evaluation.js
@@ -0,0 +1,43 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed-err-evaluation.case
+// - src/accessor-names/error/cls-expr-static.template
+/*---
+description: Abrupt completion when evaluating expression (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+---*/
+var thrower = function() {
+ throw new Test262Error();
+};
+
+
+assert.throws(Test262Error, function() {
+ 0, class {
+ static get [thrower()]() {}
+ };
+}, '`get` accessor');
+
+assert.throws(Test262Error, function() {
+ 0, class {
+ static set [thrower()](_) {}
+ };
+}, '`set` accessor');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-to-prop-key.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-to-prop-key.js
new file mode 100644
index 0000000000..f3e8425e42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-to-prop-key.js
@@ -0,0 +1,59 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed-err-to-prop-key.case
+// - src/accessor-names/error/cls-expr-static.template
+/*---
+description: Abrupt completion when coercing to property key value (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+ 7.1.14 ToPropertyKey
+
+ 1. Let key be ? ToPrimitive(argument, hint String).
+
+ 7.1.1 ToPrimitive
+
+ [...]
+ 7. Return ? OrdinaryToPrimitive(input, hint).
+
+ 7.1.1.1 OrdinaryToPrimitive
+
+ 5. For each name in methodNames in List order, do
+ [...]
+ 6. Throw a TypeError exception.
+---*/
+var badKey = Object.create(null);
+
+
+assert.throws(TypeError, function() {
+ 0, class {
+ static get [badKey]() {}
+ };
+}, '`get` accessor');
+
+assert.throws(TypeError, function() {
+ 0, class {
+ static set [badKey](_) {}
+ };
+}, '`set` accessor');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-unresolvable.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-unresolvable.js
new file mode 100644
index 0000000000..228eb04357
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed-err-unresolvable.js
@@ -0,0 +1,41 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed-err-unresolvable.case
+// - src/accessor-names/error/cls-expr-static.template
+/*---
+description: Abrupt completion when resolving reference value (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+---*/
+
+assert.throws(ReferenceError, function() {
+ 0, class {
+ static get [test262unresolvable]() {}
+ };
+}, '`get` accessor');
+
+assert.throws(ReferenceError, function() {
+ 0, class {
+ static set [test262unresolvable](_) {}
+ };
+}, '`set` accessor');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/computed.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed.js
new file mode 100644
index 0000000000..ec951995c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/computed.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/computed.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (AssignmentExpression) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+var _;
+
+
+var stringSet;
+
+var C = class {
+ static get [_ = 'str' + 'ing']() { return 'get string'; }
+ static set [_ = 'str' + 'ing'](param) { stringSet = param; }
+};
+
+assert.sameValue(C['string'], 'get string');
+
+C['string'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-binary.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-binary.js
new file mode 100644
index 0000000000..c3ba7f2960
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-binary.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-binary.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal in binary notation) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 0b10() { return 'get string'; }
+ static set 0b10(param) { stringSet = param; }
+};
+
+assert.sameValue(C['2'], 'get string');
+
+C['2'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-exponent.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-exponent.js
new file mode 100644
index 0000000000..32357b4e1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-exponent.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-exponent.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal in exponent notation) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 1E+9() { return 'get string'; }
+ static set 1E+9(param) { stringSet = param; }
+};
+
+assert.sameValue(C['1000000000'], 'get string');
+
+C['1000000000'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-hex.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-hex.js
new file mode 100644
index 0000000000..f026315b35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-hex.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-hex.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal in hexadecimal notation) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 0x10() { return 'get string'; }
+ static set 0x10(param) { stringSet = param; }
+};
+
+assert.sameValue(C['16'], 'get string');
+
+C['16'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-leading-decimal.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-leading-decimal.js
new file mode 100644
index 0000000000..cc08f3ddca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-leading-decimal.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-leading-decimal.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal with leading decimal point) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get .1() { return 'get string'; }
+ static set .1(param) { stringSet = param; }
+};
+
+assert.sameValue(C['0.1'], 'get string');
+
+C['0.1'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-non-canonical.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-non-canonical.js
new file mode 100644
index 0000000000..39e47c1181
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-non-canonical.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-non-canonical.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal with non-canonical representation) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 0.0000001() { return 'get string'; }
+ static set 0.0000001(param) { stringSet = param; }
+};
+
+assert.sameValue(C['1e-7'], 'get string');
+
+C['1e-7'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-octal.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-octal.js
new file mode 100644
index 0000000000..b2c7ca1f1a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-octal.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-octal.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal in octal notation) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 0o10() { return 'get string'; }
+ static set 0o10(param) { stringSet = param; }
+};
+
+assert.sameValue(C['8'], 'get string');
+
+C['8'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-zero.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-zero.js
new file mode 100644
index 0000000000..9c35644e70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-numeric-zero.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-numeric-zero.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (numeric literal zero) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 0() { return 'get string'; }
+ static set 0(param) { stringSet = param; }
+};
+
+assert.sameValue(C['0'], 'get string');
+
+C['0'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-char-escape.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-char-escape.js
new file mode 100644
index 0000000000..a06309695b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-char-escape.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-char-escape.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal containing a character escape sequence) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'character\tescape'() { return 'get string'; }
+ static set 'character\tescape'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['character escape'], 'get string');
+
+C['character escape'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped-ext.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped-ext.js
new file mode 100644
index 0000000000..ed289ed715
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped-ext.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-default-escaped-ext.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal 'default' w/ extended escape) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'def\u{61}ult'() { return 'get string'; }
+ static set 'def\u{61}ult'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['default'], 'get string');
+
+C['default'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped.js
new file mode 100644
index 0000000000..23d77c253e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default-escaped.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-default-escaped.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal 'default' escaped) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'def\u0061ult'() { return 'get string'; }
+ static set 'def\u0061ult'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['default'], 'get string');
+
+C['default'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default.js
new file mode 100644
index 0000000000..84a06533f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-default.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-default.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal 'default') (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'default'() { return 'get string'; }
+ static set 'default'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['default'], 'get string');
+
+C['default'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-double-quote.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-double-quote.js
new file mode 100644
index 0000000000..c3a526570b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-double-quote.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-double-quote.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal using double quotes) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get "doubleQuote"() { return 'get string'; }
+ static set "doubleQuote"(param) { stringSet = param; }
+};
+
+assert.sameValue(C["doubleQuote"], 'get string');
+
+C["doubleQuote"] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-empty.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-empty.js
new file mode 100644
index 0000000000..3feec726a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-empty.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-empty.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal, the empty string) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get ''() { return 'get string'; }
+ static set ''(param) { stringSet = param; }
+};
+
+assert.sameValue(C[''], 'get string');
+
+C[''] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-hex-escape.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-hex-escape.js
new file mode 100644
index 0000000000..beec9cf6d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-hex-escape.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-hex-escape.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal containing a hexadecimal escape sequence) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'hex\x45scape'() { return 'get string'; }
+ static set 'hex\x45scape'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['hexEscape'], 'get string');
+
+C['hexEscape'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-line-continuation.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-line-continuation.js
new file mode 100644
index 0000000000..9d31f74baa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-line-continuation.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-line-continuation.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal containing LineContinuation) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'line\
+Continuation'() { return 'get string'; }
+ static set 'line\
+Continuation'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['lineContinuation'], 'get string');
+
+C['lineContinuation'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-single-quote.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-single-quote.js
new file mode 100644
index 0000000000..a96110be21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-single-quote.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-single-quote.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal using single quotes) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'singleQuote'() { return 'get string'; }
+ static set 'singleQuote'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['singleQuote'], 'get string');
+
+C['singleQuote'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-unicode-escape.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-unicode-escape.js
new file mode 100644
index 0000000000..848763813d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/literal-string-unicode-escape.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/literal-string-unicode-escape.case
+// - src/accessor-names/default/cls-expr-static.template
+/*---
+description: Computed values as accessor property names (string literal containing a Unicode escape sequence) (Class expression, static method)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class]
+flags: [generated]
+info: |
+ [...]
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ [...]
+ b. Else,
+ a. Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+
+
+ 12.2.6.7 Runtime Semantics: Evaluation
+
+ [...]
+
+ ComputedPropertyName : [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+---*/
+
+var stringSet;
+
+var C = class {
+ static get 'unicod\u{000065}Escape'() { return 'get string'; }
+ static set 'unicod\u{000065}Escape'(param) { stringSet = param; }
+};
+
+assert.sameValue(C['unicodeEscape'], 'get string');
+
+C['unicodeEscape'] = 'set string';
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/accessor-name-static/shell.js b/js/src/tests/test262/language/expressions/class/accessor-name-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/accessor-name-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..18d651813a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..cb0dbc30ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js
new file mode 100644
index 0000000000..e3e77ae799
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..41b8c7147b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js
new file mode 100644
index 0000000000..b23a831929
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..41a12db02a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ \u0061wait: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js
new file mode 100644
index 0000000000..06d3af15ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ await: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js
new file mode 100644
index 0000000000..f17f3d275b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..2a3a5562f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Use of initializer when argument value is not `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(false, '', NaN, 0, null, obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..ef1e1a2b32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Use of initializer when argument value is `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(undefined, void 0).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js
new file mode 100644
index 0000000000..65abb8af33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js
@@ -0,0 +1,67 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js
new file mode 100644
index 0000000000..6d665d047a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..8e6e10f9e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(3).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js
new file mode 100644
index 0000000000..740bb85ea7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Referencing a parameter from within its own initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js
new file mode 100644
index 0000000000..cfd765922b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js
@@ -0,0 +1,71 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: RestParameter does not support an initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..517ec7a733
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, undefined, 1).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..2ec73b6b23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, f.arguments (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..ece619e5c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..7c220efb23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..dda9f82e82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..81fab0dc85
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..2467a34a7f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..ca607f5a4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, 39, 1).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 2, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js
new file mode 100644
index 0000000000..a3b75af329
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, 39).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js
new file mode 100644
index 0000000000..cf706d7220
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..e71309571f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,64 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..848d6e2303
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..675f2b0765
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..985f0c11aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..20327d4b46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..3e5569fd45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js
new file mode 100644
index 0000000000..c73d866f7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..2915340212
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-spread-strict.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [object-spread, async-iteration]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..2fd9c7eeae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-strict.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js
new file mode 100644
index 0000000000..5c1e7f40ec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-catch.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}).catch(rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+});
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js
new file mode 100644
index 0000000000..0ddf0f91eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-async-iterator.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: yield * [Promise.reject(value)] is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ for await (let line of readFile()) {
+ yield line;
+ }
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js
new file mode 100644
index 0000000000..ba8aa62ef4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-sync-iterator.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: yield Promise.reject(value) in for-await-of is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ for await (let value of iterable) {
+ yield value;
+ }
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js
new file mode 100644
index 0000000000..f15658c275
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-async-iterator.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield * readFile();
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}, $DONE).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js
new file mode 100644
index 0000000000..ca4525ad9e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-sync-iterator.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield * iterable;
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js
new file mode 100644
index 0000000000..c27d2c7d36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..5b3687ddad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-multiple.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield [...yield yield];
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+
+item.then(({ done, value }) => {
+ item = iter.next(value);
+
+ item.then(({ done, value }) => {
+ assert.compareArray(value, arr);
+ assert.sameValue(done, false);
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js
new file mode 100644
index 0000000000..f0559193f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-single.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield [...yield];
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next(false);
+var item = iter.next(arr);
+
+item.then(({ done, value }) => {
+ assert.notSameValue(value, arr, 'value is a new array');
+ assert(Array.isArray(value), 'value is an Array exotic object');
+ assert.sameValue(value.length, 3)
+ assert.sameValue(value[0], 'a');
+ assert.sameValue(value[1], 'b');
+ assert.sameValue(value[2], 'c');
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js
new file mode 100644
index 0000000000..73e7b5d674
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js
@@ -0,0 +1,59 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-obj.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Use yield value in a object spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [object-spread, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+item.then(({ done, value }) => {
+ assert.sameValue(value.x, 42);
+ assert.sameValue(value.y, 39);
+ assert.sameValue(Object.keys(value).length, 2);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js
new file mode 100644
index 0000000000..77006a1cce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js
@@ -0,0 +1,226 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-next.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Execution order for yield* with async iterator and next() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({ name: "get [Symbol.iterator]" });
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({
+ name: "get [Symbol.asyncIterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.asyncIterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-promise-1",
+ get then() {
+ log.push({
+ name: "get next then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "next-promise-2",
+ get then() {
+ log.push({
+ name: "get next then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+ assert.sameValue(log[1].thisValue, obj, "get [Symbol.asyncIterator] thisValue");
+
+ assert.sameValue(log[2].name, "call [Symbol.asyncIterator]");
+ assert.sameValue(log[2].thisValue, obj, "[Symbol.asyncIterator] thisValue");
+ assert.sameValue(log[2].args.length, 0, "[Symbol.asyncIterator] args.length");
+
+ assert.sameValue(log[3].name, "get next");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "get next thisValue");
+
+ assert.sameValue(log[4].name, "call next");
+ assert.sameValue(log[4].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[4].args.length, 1, "next args.length");
+ assert.sameValue(log[4].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[5].name, "get next then (1)");
+ assert.sameValue(log[5].thisValue.name, "next-promise-1", "get next then thisValue");
+
+ assert.sameValue(log[6].name, "call next then (1)");
+ assert.sameValue(log[6].thisValue.name, "next-promise-1", "next then thisValue");
+ assert.sameValue(log[6].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[6].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[6].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[7].name, "get next done (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[8].name, "get next value (1)");
+ assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 9, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[9].name, "call next");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[9].args.length, 1, "next args.length");
+ assert.sameValue(log[9].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[10].name, "get next then (2)");
+ assert.sameValue(log[10].thisValue.name, "next-promise-2", "get next then thisValue");
+
+ assert.sameValue(log[11].name, "call next then (2)");
+ assert.sameValue(log[11].thisValue.name, "next-promise-2", "next then thisValue");
+ assert.sameValue(log[11].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[12].name, "get next done (2)");
+ assert.sameValue(log[12].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[13].name, "get next value (2)");
+ assert.sameValue(log[13].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js
new file mode 100644
index 0000000000..2516c2a72e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js
@@ -0,0 +1,242 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-return.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: execution order for yield* with async iterator and return() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. If generatorKind is async, then set value to ? Await(value).
+ 3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
+ ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var returnCount = 0;
+ return {
+ name: 'asyncIterator',
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-promise-1",
+ get then() {
+ log.push({
+ name: "get return then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "return-promise-2",
+ get then() {
+ log.push({
+ name: "get return then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return then (1)");
+ assert.sameValue(log[4].thisValue.name, "return-promise-1", "get return then thisValue");
+
+ assert.sameValue(log[5].name, "call return then (1)");
+ assert.sameValue(log[5].thisValue.name, "return-promise-1", "return then thisValue");
+ assert.sameValue(log[5].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[6].name, "get return done (1)");
+ assert.sameValue(log[6].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[7].name, "get return value (1)");
+ assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.return("return-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get return");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[9].name, "call return");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[9].args.length, 1, "return args.length");
+ assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
+
+ assert.sameValue(log[10].name, "get return then (2)");
+ assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
+
+ assert.sameValue(log[11].name, "call return then (2)");
+ assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
+ assert.sameValue(log[11].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[12].name, "get return done (2)");
+ assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[13].name, "get return value (2)");
+ assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 14, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js
new file mode 100644
index 0000000000..0d6cdc421e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js
@@ -0,0 +1,250 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: execution order for yield* with async iterator and throw() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Let resultValue be Return ? IteratorValue(innerResult).
+ b. If generatorKind is async, then set resultValue to ? Await(resultValue).
+ c. Return resultValue.
+ 7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var throwCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-promise-1",
+ get then() {
+ log.push({
+ name: "get throw then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "throw-promise-2",
+ get then() {
+ log.push({
+ name: "get throw then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw then (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-promise-1", "get throw thisValue");
+
+ assert.sameValue(log[5].name, "call throw then (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-promise-1", "throw thisValue");
+ assert.sameValue(log[5].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[6].name, "get throw done (1)");
+ assert.sameValue(log[6].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[7].name, "get throw value (1)");
+ assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.throw("throw-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get throw");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[9].name, "call throw");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[9].args.length, 1, "throw args.length");
+ assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
+
+ assert.sameValue(log[10].name, "get throw then (2)");
+ assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
+
+ assert.sameValue(log[11].name, "call throw then (2)");
+ assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
+ assert.sameValue(log[11].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[12].name, "get throw done (2)");
+ assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[13].name, "get throw value (2)");
+ assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js
new file mode 100644
index 0000000000..ab36902e14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-expr-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting yield* operand (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ ...
+
+---*/
+var obj = {};
+var abrupt = function() {
+ throw obj;
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* abrupt();
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, obj, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js
new file mode 100644
index 0000000000..8423d139da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ get [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..0bea4fb881
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js
new file mode 100644
index 0000000000..d639f47d22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js
new file mode 100644
index 0000000000..70dd974ccb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js
new file mode 100644
index 0000000000..c929f3f8ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..50c5f612ec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: Symbol.asyncIterator
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js
new file mode 100644
index 0000000000..f9e4844ad7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-null-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting @@iterator after null @@asyncIterator (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js
new file mode 100644
index 0000000000..dc07a3ab87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while calling [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js
new file mode 100644
index 0000000000..1a595bfff9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js
new file mode 100644
index 0000000000..a0e258e425
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js
new file mode 100644
index 0000000000..5f1e760494
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return 42;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js
new file mode 100644
index 0000000000..8b72208062
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return '42';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js
new file mode 100644
index 0000000000..ccd4dd4443
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return Symbol.asyncIterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js
new file mode 100644
index 0000000000..9454e665eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js
new file mode 100644
index 0000000000..8c361b1ede
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-undefined-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting @@iterator after undefined @@asyncIterator (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js
new file mode 100644
index 0000000000..c4db55c988
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting [Symbol.iterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..2f35228833
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js
new file mode 100644
index 0000000000..87ce580b29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js
new file mode 100644
index 0000000000..05bd91d537
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js
new file mode 100644
index 0000000000..c79a527bdf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..944bd7b03b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: Symbol.iterator
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js
new file mode 100644
index 0000000000..7b1224fcb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while calling [Symbol.iterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js
new file mode 100644
index 0000000000..dcc5671a33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js
new file mode 100644
index 0000000000..15a42cb2f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js
new file mode 100644
index 0000000000..95b9e5b0fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return 0;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js
new file mode 100644
index 0000000000..ab2651614a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return '';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js
new file mode 100644
index 0000000000..e9398720b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return Symbol.iterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js
new file mode 100644
index 0000000000..d2a4b81361
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js
new file mode 100644
index 0000000000..0ecfce6ee1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-done-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting done (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get done() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js
new file mode 100644
index 0000000000..34327e9c8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while calling next (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js
new file mode 100644
index 0000000000..12bcdc3a53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-value-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ done: true,
+ get value() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js
new file mode 100644
index 0000000000..cbfd49c469
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Abrupt completion while getting next (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ get next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js
new file mode 100644
index 0000000000..d3b19be4ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-non-object-ignores-then.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: If next() value is not-object, do not access respective then property (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+
+---*/
+Number.prototype.then = function() {
+ throw new Test262Error('Number#then should not be used');
+};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return 42;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, 'TypeError');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..0debc00d3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: true
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js
new file mode 100644
index 0000000000..d4fa526281
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-null-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: null
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js
new file mode 100644
index 0000000000..9534329e08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: 42
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js
new file mode 100644
index 0000000000..f8f3f30d4a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - object (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: {}
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js
new file mode 100644
index 0000000000..cd023a3cb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: ''
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..8b32699f31
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: Symbol('oi')
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js
new file mode 100644
index 0000000000..7ac924904b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-undefined-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Not-callable next value in a yield star position - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: undefined
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js
new file mode 100644
index 0000000000..b2ff498c30
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Return abrupt after getting next().then (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js
new file mode 100644
index 0000000000..37ad663120
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-boolean-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: true,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js
new file mode 100644
index 0000000000..13d0bea58f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-null-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (null) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: null,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js
new file mode 100644
index 0000000000..cf43777058
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-number-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: 39,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js
new file mode 100644
index 0000000000..9ae9c7c066
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-object-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: {},
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js
new file mode 100644
index 0000000000..b2698f6372
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-string-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: '',
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js
new file mode 100644
index 0000000000..9a207839b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-symbol-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: Symbol('oi'),
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js
new file mode 100644
index 0000000000..233e347afe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-undefined-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (undefined) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: undefined,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js
new file mode 100644
index 0000000000..1f779ab5d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Return abrupt after calling next().then (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js
new file mode 100644
index 0000000000..81133c9bf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js
@@ -0,0 +1,229 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-next.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: execution order for yield* with sync iterator and next() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ 5. Let received be NormalCompletion(undefined).
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ vii. Let received be GeneratorYield(innerResult).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.next ( value )
+
+ ...
+ 5. Let nextResult be IteratorNext(syncIterator, value).
+ ...
+ 7. Let nextValue be IteratorValue(nextResult).
+ ...
+ 9. Let nextDone be IteratorComplete(nextResult).
+ ...
+ 12. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « nextValue »).
+ ...
+ 14. Set onFulfilled.[[Done]] to nextDone.
+ 15. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+ Async Iterator Value Unwrap Functions
+
+ 1. Return ! CreateIterResultObject(value, F.[[Done]]).
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({
+ name: "get [Symbol.iterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.iterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ };
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({ name: "get [Symbol.asyncIterator]" });
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+
+ assert.sameValue(log[2].name, "get [Symbol.iterator]");
+ assert.sameValue(log[2].thisValue, obj, "get [Symbol.iterator] thisValue");
+
+ assert.sameValue(log[3].name, "call [Symbol.iterator]");
+ assert.sameValue(log[3].thisValue, obj, "[Symbol.iterator] thisValue");
+ assert.sameValue(log[3].args.length, 0, "[Symbol.iterator] args.length");
+
+ assert.sameValue(log[4].name, "get next");
+ assert.sameValue(log[4].thisValue.name, "syncIterator", "get next thisValue");
+
+ assert.sameValue(log[5].name, "call next");
+ assert.sameValue(log[5].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[5].args.length, 1, "next args.length");
+ assert.sameValue(log[5].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[6].name, "get next done (1)");
+ assert.sameValue(log[6].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[7].name, "get next value (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[8].name, "call next");
+ assert.sameValue(log[8].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[8].args.length, 1, "next args.length");
+ assert.sameValue(log[8].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[9].name, "get next done (2)");
+ assert.sameValue(log[9].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[10].name, "get next value (2)");
+ assert.sameValue(log[10].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[11].name, "after yield*");
+ assert.sameValue(log[11].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 12, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js
new file mode 100644
index 0000000000..4d531aa88b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js
@@ -0,0 +1,204 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-return.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: execution order for yield* with sync iterator and return() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator,
+ « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to
+ ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. Return Completion{[[Type]]: return, [[Value]]: value,
+ [[Target]]: empty}.
+ ix. Let received be GeneratorYield(innerResult).
+
+ %AsyncFromSyncIteratorPrototype%.return ( value )
+
+ 5. Let return be GetMethod(syncIterator, "return").
+ ...
+ ...
+ 8. Let returnResult be Call(return, syncIterator, « value »).
+ ...
+ 11. Let returnValue be IteratorValue(returnResult).
+ ..
+ 13. Let returnDone be IteratorComplete(returnResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined, « returnValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to returnDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var returnCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return done (1)");
+ assert.sameValue(log[4].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[5].name, "get return value (1)");
+ assert.sameValue(log[5].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.return().then(v => {
+ assert.sameValue(log[6].name, "get return");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[7].name, "call return");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "get return thisValue");
+ assert.sameValue(log[7].args.length, 1, "return args.length");
+ assert.sameValue(log[7].args[0], undefined, "return args[0]");
+
+ assert.sameValue(log[8].name, "get return done (2)");
+ assert.sameValue(log[8].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[9].name, "get return value (2)");
+ assert.sameValue(log[9].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 10, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js
new file mode 100644
index 0000000000..14af8af227
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js
@@ -0,0 +1,210 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-throw.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: execution order for yield* with sync iterator and throw() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Return ? IteratorValue(innerResult).
+ 7. Let received be GeneratorYield(innerResult).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.throw ( value )
+
+ ...
+ 5. Let throw be GetMethod(syncIterator, "throw").
+ ...
+ 8. Let throwResult be Call(throw, syncIterator, « value »).
+ ...
+ 11. Let throwValue be IteratorValue(throwResult).
+ ...
+ 13. Let throwDone be IteratorComplete(throwResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « throwValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to throwDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var throwCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw done (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[5].name, "get throw value (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.throw().then(v => {
+ assert.sameValue(log[6].name, "get throw");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[7].name, "call throw");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[7].args.length, 1, "throw args.length");
+ assert.sameValue(log[7].args[0], undefined, "throw args[0]");
+
+ assert.sameValue(log[8].name, "get throw done (2)");
+ assert.sameValue(log[8].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[9].name, "get throw value (2)");
+ assert.sameValue(log[9].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[10].name, "after yield*");
+ assert.sameValue(log[10].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 11, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..c16ca08978
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/array-destructuring-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ async *method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..e22f72fdbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ var \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier.js
new file mode 100644
index 0000000000..8bf28e111d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ var await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..f3a30e134b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ void \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference.js
new file mode 100644
index 0000000000..259c5176a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ void await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..8dd16b35de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ \u0061wait: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier.js
new file mode 100644
index 0000000000..6f1c9dbbc5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/await-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ await: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-abrupt.js
new file mode 100644
index 0000000000..c10b79e716
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-abrupt.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-async-gen-meth.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..6bb0b08cfd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,93 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-async-gen-meth.template
+/*---
+description: Use of initializer when argument value is not `undefined` (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ async *method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(false, '', NaN, 0, null, obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..d8a13acfce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-arg-val-undefined.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-async-gen-meth.template
+/*---
+description: Use of initializer when argument value is `undefined` (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(undefined, void 0).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-duplicates.js
new file mode 100644
index 0000000000..004c935066
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-duplicates.js
@@ -0,0 +1,67 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ async *method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-later.js
new file mode 100644
index 0000000000..1a285cb39e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-later.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-async-gen-meth.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ async *method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..16a012d9b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-prior.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-async-gen-meth.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ async *method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(3).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-self.js
new file mode 100644
index 0000000000..a3eaebb636
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-ref-self.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-async-gen-meth.template
+/*---
+description: Referencing a parameter from within its own initializer (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ async *method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-rest.js
new file mode 100644
index 0000000000..2f348a7ada
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-rest.js
@@ -0,0 +1,71 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth.template
+/*---
+description: RestParameter does not support an initializer (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ async *method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..52c4d3287d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/dflt-params-trailing-comma.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-async-gen-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(42, undefined, 1).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..53f4575bfe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-gen-meth.template
+/*---
+description: Forbidden extension, f.arguments (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..92118097dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/cls-expr-async-gen-meth-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..ab7c5b0f39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.prototype.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..233678f3ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.prototype.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..6d823b39f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/cls-expr-async-gen-meth-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.prototype.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..b647a0b0b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/object-destructuring-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ async *method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..dbd51bef6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-multiple.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-async-gen-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(42, 39, 1).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+
+assert.sameValue(ref.length, 2, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-single.js
new file mode 100644
index 0000000000..29b2e9692a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/params-trailing-comma-single.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-async-gen-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(42, 39).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method/rest-param-strict-body.js
new file mode 100644
index 0000000000..40c6345951
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/rest-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ async *method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/async-gen-method/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..dfdccd7ef6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,64 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ async *method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..0109b987e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..bf0f427bff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..09ad53238d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..c86954afe0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..a7c727dd3f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier.js
new file mode 100644
index 0000000000..5db2d93e23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..def949e744
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-spread-strict.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [object-spread, async-iteration]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..ae695c0bb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-identifier-strict-strict.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-strict.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-catch.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-catch.js
new file mode 100644
index 0000000000..8fa4477142
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-catch.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-catch.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}).catch(rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+});
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-async-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-async-iterator.js
new file mode 100644
index 0000000000..aee7324045
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-async-iterator.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-async-iterator.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: yield * [Promise.reject(value)] is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ for await (let line of readFile()) {
+ yield line;
+ }
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-sync-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-sync-iterator.js
new file mode 100644
index 0000000000..2720fce01d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-for-await-of-sync-iterator.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-sync-iterator.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: yield Promise.reject(value) in for-await-of is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ for await (let value of iterable) {
+ yield value;
+ }
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-async-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-async-iterator.js
new file mode 100644
index 0000000000..787c3a5a40
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-async-iterator.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-async-iterator.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield * readFile();
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}, $DONE).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-sync-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-sync-iterator.js
new file mode 100644
index 0000000000..7aa5a731f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next-yield-star-sync-iterator.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-sync-iterator.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield * iterable;
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next.js
new file mode 100644
index 0000000000..33ce752493
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-promise-reject-next.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..142075c441
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-multiple.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-multiple.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Use yield value in a array spread position (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield [...yield yield];
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+
+item.then(({ done, value }) => {
+ item = iter.next(value);
+
+ item.then(({ done, value }) => {
+ assert.compareArray(value, arr);
+ assert.sameValue(done, false);
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-single.js
new file mode 100644
index 0000000000..837de17674
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-arr-single.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-single.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Use yield value in a array spread position (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield [...yield];
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next(false);
+var item = iter.next(arr);
+
+item.then(({ done, value }) => {
+ assert.notSameValue(value, arr, 'value is a new array');
+ assert(Array.isArray(value), 'value is an Array exotic object');
+ assert.sameValue(value.length, 3)
+ assert.sameValue(value[0], 'a');
+ assert.sameValue(value[1], 'b');
+ assert.sameValue(value[2], 'c');
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-obj.js
new file mode 100644
index 0000000000..4d167a826c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-spread-obj.js
@@ -0,0 +1,59 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-obj.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Use yield value in a object spread position (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [object-spread, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+item.then(({ done, value }) => {
+ assert.sameValue(value.x, 42);
+ assert.sameValue(value.y, 39);
+ assert.sameValue(Object.keys(value).length, 2);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-next.js
new file mode 100644
index 0000000000..b7ea728c98
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-next.js
@@ -0,0 +1,226 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-next.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Execution order for yield* with async iterator and next() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({ name: "get [Symbol.iterator]" });
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({
+ name: "get [Symbol.asyncIterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.asyncIterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-promise-1",
+ get then() {
+ log.push({
+ name: "get next then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "next-promise-2",
+ get then() {
+ log.push({
+ name: "get next then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+ assert.sameValue(log[1].thisValue, obj, "get [Symbol.asyncIterator] thisValue");
+
+ assert.sameValue(log[2].name, "call [Symbol.asyncIterator]");
+ assert.sameValue(log[2].thisValue, obj, "[Symbol.asyncIterator] thisValue");
+ assert.sameValue(log[2].args.length, 0, "[Symbol.asyncIterator] args.length");
+
+ assert.sameValue(log[3].name, "get next");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "get next thisValue");
+
+ assert.sameValue(log[4].name, "call next");
+ assert.sameValue(log[4].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[4].args.length, 1, "next args.length");
+ assert.sameValue(log[4].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[5].name, "get next then (1)");
+ assert.sameValue(log[5].thisValue.name, "next-promise-1", "get next then thisValue");
+
+ assert.sameValue(log[6].name, "call next then (1)");
+ assert.sameValue(log[6].thisValue.name, "next-promise-1", "next then thisValue");
+ assert.sameValue(log[6].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[6].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[6].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[7].name, "get next done (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[8].name, "get next value (1)");
+ assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 9, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[9].name, "call next");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[9].args.length, 1, "next args.length");
+ assert.sameValue(log[9].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[10].name, "get next then (2)");
+ assert.sameValue(log[10].thisValue.name, "next-promise-2", "get next then thisValue");
+
+ assert.sameValue(log[11].name, "call next then (2)");
+ assert.sameValue(log[11].thisValue.name, "next-promise-2", "next then thisValue");
+ assert.sameValue(log[11].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[12].name, "get next done (2)");
+ assert.sameValue(log[12].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[13].name, "get next value (2)");
+ assert.sameValue(log[13].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-return.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-return.js
new file mode 100644
index 0000000000..7576248cba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-return.js
@@ -0,0 +1,242 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-return.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: execution order for yield* with async iterator and return() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. If generatorKind is async, then set value to ? Await(value).
+ 3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
+ ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var returnCount = 0;
+ return {
+ name: 'asyncIterator',
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-promise-1",
+ get then() {
+ log.push({
+ name: "get return then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "return-promise-2",
+ get then() {
+ log.push({
+ name: "get return then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return then (1)");
+ assert.sameValue(log[4].thisValue.name, "return-promise-1", "get return then thisValue");
+
+ assert.sameValue(log[5].name, "call return then (1)");
+ assert.sameValue(log[5].thisValue.name, "return-promise-1", "return then thisValue");
+ assert.sameValue(log[5].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[6].name, "get return done (1)");
+ assert.sameValue(log[6].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[7].name, "get return value (1)");
+ assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.return("return-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get return");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[9].name, "call return");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[9].args.length, 1, "return args.length");
+ assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
+
+ assert.sameValue(log[10].name, "get return then (2)");
+ assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
+
+ assert.sameValue(log[11].name, "call return then (2)");
+ assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
+ assert.sameValue(log[11].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[12].name, "get return done (2)");
+ assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[13].name, "get return value (2)");
+ assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 14, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-throw.js
new file mode 100644
index 0000000000..5bd4d4cc46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-async-throw.js
@@ -0,0 +1,250 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: execution order for yield* with async iterator and throw() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Let resultValue be Return ? IteratorValue(innerResult).
+ b. If generatorKind is async, then set resultValue to ? Await(resultValue).
+ c. Return resultValue.
+ 7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var throwCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-promise-1",
+ get then() {
+ log.push({
+ name: "get throw then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "throw-promise-2",
+ get then() {
+ log.push({
+ name: "get throw then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw then (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-promise-1", "get throw thisValue");
+
+ assert.sameValue(log[5].name, "call throw then (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-promise-1", "throw thisValue");
+ assert.sameValue(log[5].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[6].name, "get throw done (1)");
+ assert.sameValue(log[6].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[7].name, "get throw value (1)");
+ assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.throw("throw-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get throw");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[9].name, "call throw");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[9].args.length, 1, "throw args.length");
+ assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
+
+ assert.sameValue(log[10].name, "get throw then (2)");
+ assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
+
+ assert.sameValue(log[11].name, "call throw then (2)");
+ assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
+ assert.sameValue(log[11].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[12].name, "get throw done (2)");
+ assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[13].name, "get throw value (2)");
+ assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-expr-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-expr-abrupt.js
new file mode 100644
index 0000000000..3a61489670
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-expr-abrupt.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-expr-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting yield* operand (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ ...
+
+---*/
+var obj = {};
+var abrupt = function() {
+ throw obj;
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* abrupt();
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, obj, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-get-abrupt.js
new file mode 100644
index 0000000000..81387bf277
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-get-abrupt.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting [Symbol.asyncIterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ get [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..a498a74010
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-boolean-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (boolean) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-number-throw.js
new file mode 100644
index 0000000000..0e58048378
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-number-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (number) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-object-throw.js
new file mode 100644
index 0000000000..7d495eb60f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-object-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (object) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-string-throw.js
new file mode 100644
index 0000000000..1d6ba763a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-string-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (string) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..cb72ada25c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-not-callable-symbol-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (symbol) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: Symbol.asyncIterator
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-null-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-null-sync-get-abrupt.js
new file mode 100644
index 0000000000..8c8c0c4427
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-null-sync-get-abrupt.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-null-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting @@iterator after null @@asyncIterator (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-abrupt.js
new file mode 100644
index 0000000000..22b3c7baa8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-abrupt.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while calling [Symbol.asyncIterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-boolean-throw.js
new file mode 100644
index 0000000000..f79209c84d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-boolean-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - boolean (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-null-throw.js
new file mode 100644
index 0000000000..a4f4769014
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-null-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - null (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-number-throw.js
new file mode 100644
index 0000000000..39acd5c11f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-number-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - number (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return 42;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-string-throw.js
new file mode 100644
index 0000000000..fe4731d99b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-string-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - string (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return '42';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-symbol-throw.js
new file mode 100644
index 0000000000..8d92764f68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-symbol-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - symbol (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return Symbol.asyncIterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-undefined-throw.js
new file mode 100644
index 0000000000..ce9b638b74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-returns-undefined-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - undefined (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-undefined-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-undefined-sync-get-abrupt.js
new file mode 100644
index 0000000000..2f6e003ed0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-async-undefined-sync-get-abrupt.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-undefined-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting @@iterator after undefined @@asyncIterator (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-get-abrupt.js
new file mode 100644
index 0000000000..f9b78d9c22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-get-abrupt.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting [Symbol.iterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..f060398336
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-boolean-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (boolean) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-number-throw.js
new file mode 100644
index 0000000000..c51cf5d66b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-number-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (number) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-object-throw.js
new file mode 100644
index 0000000000..89b2b3f481
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-object-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (object) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-string-throw.js
new file mode 100644
index 0000000000..a90d40a75e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-string-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (string) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..624f8b6290
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-not-callable-symbol-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (symbol) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: Symbol.iterator
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-abrupt.js
new file mode 100644
index 0000000000..fa37104bd0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-abrupt.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while calling [Symbol.iterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-boolean-throw.js
new file mode 100644
index 0000000000..ef6e916a0b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-boolean-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - boolean (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-null-throw.js
new file mode 100644
index 0000000000..4129a2a373
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-null-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - null (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-number-throw.js
new file mode 100644
index 0000000000..48fc0e55b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-number-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - number (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return 0;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-string-throw.js
new file mode 100644
index 0000000000..b3503d3a59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-string-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - string (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return '';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-symbol-throw.js
new file mode 100644
index 0000000000..c7182fe198
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-symbol-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - symbol (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return Symbol.iterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-undefined-throw.js
new file mode 100644
index 0000000000..ffff1ae489
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-getiter-sync-returns-undefined-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - undefined (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-done-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-done-get-abrupt.js
new file mode 100644
index 0000000000..dedd64f520
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-done-get-abrupt.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-done-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting done (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get done() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-returns-abrupt.js
new file mode 100644
index 0000000000..a88d30d709
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-returns-abrupt.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while calling next (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-value-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-value-get-abrupt.js
new file mode 100644
index 0000000000..4e7160fb48
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-call-value-get-abrupt.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-value-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ done: true,
+ get value() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-get-abrupt.js
new file mode 100644
index 0000000000..d3d80b214d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-get-abrupt.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Abrupt completion while getting next (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ get next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-non-object-ignores-then.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-non-object-ignores-then.js
new file mode 100644
index 0000000000..0f1633f1a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-non-object-ignores-then.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-non-object-ignores-then.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: If next() value is not-object, do not access respective then property (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+
+---*/
+Number.prototype.then = function() {
+ throw new Test262Error('Number#then should not be used');
+};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return 42;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, 'TypeError');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..415b3e8d08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-boolean-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - boolean (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: true
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-null-throw.js
new file mode 100644
index 0000000000..54fa6eb903
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-null-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-null-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - null (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: null
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-number-throw.js
new file mode 100644
index 0000000000..e14b5344d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-number-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - number (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: 42
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-object-throw.js
new file mode 100644
index 0000000000..27e2884d58
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-object-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - object (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: {}
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-string-throw.js
new file mode 100644
index 0000000000..619c164853
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-string-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - string (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: ''
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..0d7b32db5b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-symbol-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - symbol (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: Symbol('oi')
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-undefined-throw.js
new file mode 100644
index 0000000000..36f13ff0f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-not-callable-undefined-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-undefined-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Not-callable next value in a yield star position - undefined (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: undefined
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-get-abrupt.js
new file mode 100644
index 0000000000..3706079765
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-get-abrupt.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-get-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Return abrupt after getting next().then (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js
new file mode 100644
index 0000000000..7dce6f24e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-boolean-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (boolean) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: true,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-null-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-null-fulfillpromise.js
new file mode 100644
index 0000000000..38c9568bdc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-null-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-null-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (null) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: null,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-number-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-number-fulfillpromise.js
new file mode 100644
index 0000000000..02f3c40744
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-number-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-number-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (number) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: 39,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-object-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-object-fulfillpromise.js
new file mode 100644
index 0000000000..ad2d5a8392
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-object-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-object-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (object) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: {},
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-string-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-string-fulfillpromise.js
new file mode 100644
index 0000000000..62b8e3c3ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-string-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-string-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (string) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: '',
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js
new file mode 100644
index 0000000000..bf2fcff99f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-symbol-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (symbol) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: Symbol('oi'),
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js
new file mode 100644
index 0000000000..96e88bd897
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-undefined-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (undefined) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: undefined,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-returns-abrupt.js
new file mode 100644
index 0000000000..f034530c28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-next-then-returns-abrupt.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: Return abrupt after calling next().then (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-next.js
new file mode 100644
index 0000000000..7c22dc28a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-next.js
@@ -0,0 +1,229 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-next.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: execution order for yield* with sync iterator and next() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ 5. Let received be NormalCompletion(undefined).
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ vii. Let received be GeneratorYield(innerResult).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.next ( value )
+
+ ...
+ 5. Let nextResult be IteratorNext(syncIterator, value).
+ ...
+ 7. Let nextValue be IteratorValue(nextResult).
+ ...
+ 9. Let nextDone be IteratorComplete(nextResult).
+ ...
+ 12. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « nextValue »).
+ ...
+ 14. Set onFulfilled.[[Done]] to nextDone.
+ 15. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+ Async Iterator Value Unwrap Functions
+
+ 1. Return ! CreateIterResultObject(value, F.[[Done]]).
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({
+ name: "get [Symbol.iterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.iterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ };
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({ name: "get [Symbol.asyncIterator]" });
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+
+ assert.sameValue(log[2].name, "get [Symbol.iterator]");
+ assert.sameValue(log[2].thisValue, obj, "get [Symbol.iterator] thisValue");
+
+ assert.sameValue(log[3].name, "call [Symbol.iterator]");
+ assert.sameValue(log[3].thisValue, obj, "[Symbol.iterator] thisValue");
+ assert.sameValue(log[3].args.length, 0, "[Symbol.iterator] args.length");
+
+ assert.sameValue(log[4].name, "get next");
+ assert.sameValue(log[4].thisValue.name, "syncIterator", "get next thisValue");
+
+ assert.sameValue(log[5].name, "call next");
+ assert.sameValue(log[5].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[5].args.length, 1, "next args.length");
+ assert.sameValue(log[5].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[6].name, "get next done (1)");
+ assert.sameValue(log[6].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[7].name, "get next value (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[8].name, "call next");
+ assert.sameValue(log[8].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[8].args.length, 1, "next args.length");
+ assert.sameValue(log[8].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[9].name, "get next done (2)");
+ assert.sameValue(log[9].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[10].name, "get next value (2)");
+ assert.sameValue(log[10].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[11].name, "after yield*");
+ assert.sameValue(log[11].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 12, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-return.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-return.js
new file mode 100644
index 0000000000..bb82e74a88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-return.js
@@ -0,0 +1,204 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-return.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: execution order for yield* with sync iterator and return() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator,
+ « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to
+ ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. Return Completion{[[Type]]: return, [[Value]]: value,
+ [[Target]]: empty}.
+ ix. Let received be GeneratorYield(innerResult).
+
+ %AsyncFromSyncIteratorPrototype%.return ( value )
+
+ 5. Let return be GetMethod(syncIterator, "return").
+ ...
+ ...
+ 8. Let returnResult be Call(return, syncIterator, « value »).
+ ...
+ 11. Let returnValue be IteratorValue(returnResult).
+ ..
+ 13. Let returnDone be IteratorComplete(returnResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined, « returnValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to returnDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var returnCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return done (1)");
+ assert.sameValue(log[4].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[5].name, "get return value (1)");
+ assert.sameValue(log[5].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.return().then(v => {
+ assert.sameValue(log[6].name, "get return");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[7].name, "call return");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "get return thisValue");
+ assert.sameValue(log[7].args.length, 1, "return args.length");
+ assert.sameValue(log[7].args[0], undefined, "return args[0]");
+
+ assert.sameValue(log[8].name, "get return done (2)");
+ assert.sameValue(log[8].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[9].name, "get return value (2)");
+ assert.sameValue(log[9].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 10, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-throw.js
new file mode 100644
index 0000000000..a810a2cb18
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method/yield-star-sync-throw.js
@@ -0,0 +1,210 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-throw.case
+// - src/async-generators/default/async-class-expr-method.template
+/*---
+description: execution order for yield* with sync iterator and throw() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Return ? IteratorValue(innerResult).
+ 7. Let received be GeneratorYield(innerResult).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.throw ( value )
+
+ ...
+ 5. Let throw be GetMethod(syncIterator, "throw").
+ ...
+ 8. Let throwResult be Call(throw, syncIterator, « value »).
+ ...
+ 11. Let throwValue be IteratorValue(throwResult).
+ ...
+ 13. Let throwDone be IteratorComplete(throwResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « throwValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to throwDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var throwCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class { async *gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw done (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[5].name, "get throw value (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.throw().then(v => {
+ assert.sameValue(log[6].name, "get throw");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[7].name, "call throw");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[7].args.length, 1, "throw args.length");
+ assert.sameValue(log[7].args[0], undefined, "throw args[0]");
+
+ assert.sameValue(log[8].name, "get throw done (2)");
+ assert.sameValue(log[8].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[9].name, "get throw value (2)");
+ assert.sameValue(log[9].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[10].name, "after yield*");
+ assert.sameValue(log[10].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 11, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-method-static/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..8f77cfc9cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/array-destructuring-param-strict-body.js
@@ -0,0 +1,136 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-meth-static.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..80550b48a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async method() {
+ var \u0061wait;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier.js
new file mode 100644
index 0000000000..d09801447c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-binding-identifier.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier.case
+// - src/async-functions/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async method() {
+ var await;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..2c80f653fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference-escaped.case
+// - src/async-functions/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async method() {
+ void \u0061wait;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference.js
new file mode 100644
index 0000000000..259d8880c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-identifier-reference.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference.case
+// - src/async-functions/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async method() {
+ void await;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..c7a17cb1f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async method() {
+ \u0061wait: ;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier.js
new file mode 100644
index 0000000000..518a5ac331
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/await-as-label-identifier.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier.case
+// - src/async-functions/syntax/async-class-expr-static-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async method() {
+ await: ;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/browser.js b/js/src/tests/test262/language/expressions/class/async-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-abrupt.js
new file mode 100644
index 0000000000..22b35a0196
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-abrupt.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-async-meth-static.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+
+var callCount = 0;
+
+var C = class {
+ static async method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method()
+ .then(_ => {
+ throw new Test262Error('function should not be resolved');
+ }, error => assert.sameValue(error.constructor, Test262Error))
+ .then(() => {
+ assert.sameValue(callCount, 0, 'function body is not evaluated');
+ }, $DONE)
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..32116025b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-async-meth-static.template
+/*---
+description: Use of initializer when argument value is not `undefined` (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ static async method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(false, '', NaN, 0, null, obj).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..ae581db2e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-arg-val-undefined.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-async-meth-static.template
+/*---
+description: Use of initializer when argument value is `undefined` (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(undefined, void 0).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-duplicates.js
new file mode 100644
index 0000000000..10bcbf3660
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-duplicates.js
@@ -0,0 +1,65 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-async-meth-static.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-later.js
new file mode 100644
index 0000000000..fdbfb6e6a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-later.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-async-meth-static.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+
+var callCount = 0;
+
+var C = class {
+ static async method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method()
+ .then(_ => {
+ throw new Test262Error('function should not be resolved');
+ }, error => assert.sameValue(error.constructor, ReferenceError))
+ .then(() => {
+ assert.sameValue(callCount, 0, 'function body is not evaluated');
+ }, $DONE)
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..2369313da7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-prior.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-async-meth-static.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(3).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-self.js
new file mode 100644
index 0000000000..4106664cbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-ref-self.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-async-meth-static.template
+/*---
+description: Referencing a parameter from within its own initializer (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+
+var callCount = 0;
+
+var C = class {
+ static async method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method()
+ .then(_ => {
+ throw new Test262Error('function should not be resolved');
+ }, error => assert.sameValue(error.constructor, ReferenceError))
+ .then(() => {
+ assert.sameValue(callCount, 0, 'function body is not evaluated');
+ }, $DONE)
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-rest.js
new file mode 100644
index 0000000000..892b04cd31
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-rest.js
@@ -0,0 +1,69 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-async-meth-static.template
+/*---
+description: RestParameter does not support an initializer (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..a678481d43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/dflt-params-trailing-comma.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-async-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, undefined, 1).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..c849102c33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-meth-static.template
+/*---
+description: Forbidden extension, f.arguments (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+
+var callCount = 0;
+
+var C = class {
+ static async method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..bed6c42916
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/cls-expr-async-meth-static-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+
+var callCount = 0;
+
+var C = class {
+ static async method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..f1e9a83ec7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+
+var callCount = 0;
+
+var C = class {
+ static async method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..39d3ed26e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+
+var callCount = 0;
+
+var C = class {
+ static async method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..2000c1018f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/cls-expr-async-meth-static-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+
+var callCount = 0;
+
+var C = class {
+ static async method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-method-static/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..ebee36b3e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/object-destructuring-param-strict-body.js
@@ -0,0 +1,136 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-meth-static.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..9245a36899
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-multiple.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-async-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, 39, 1).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 2, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-single.js
new file mode 100644
index 0000000000..5589610434
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/params-trailing-comma-single.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-async-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, 39).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-method-static/rest-param-strict-body.js
new file mode 100644
index 0000000000..438c8cd629
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/rest-param-strict-body.js
@@ -0,0 +1,136 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-meth-static.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/async-method-static/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..a3d2b167d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,61 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-async-meth-static.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-arguments-from-parent-function.js b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-arguments-from-parent-function.js
new file mode 100644
index 0000000000..0bbe6ede08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-arguments-from-parent-function.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-arguments-from-parent-function.case
+// - src/async-functions/evaluation/async-class-expr-static-method.template
+/*---
+description: Async function returns an async function. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async method(x) {
+ let a = arguments;
+ return async () => a === arguments;
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method;
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, true);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-newtarget.js
new file mode 100644
index 0000000000..a7895ab6bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow-returns-newtarget.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-static-method.template
+/*---
+description: Async function returns an async function. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async method(x) {
+ return async () => new.target;
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method;
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow.js b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow.js
new file mode 100644
index 0000000000..42514c802f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-arrow.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow.case
+// - src/async-functions/evaluation/async-class-expr-static-method.template
+/*---
+description: Async function returns an async function. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async method(x) {
+ return async () => x;
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method;
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-arguments-from-own-function.js b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-arguments-from-own-function.js
new file mode 100644
index 0000000000..50c0bba57b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-arguments-from-own-function.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-arguments-from-own-function.case
+// - src/async-functions/evaluation/async-class-expr-static-method.template
+/*---
+description: Async function returns an async function. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async method(x) {
+ let a = arguments;
+ return async function() { return a === arguments; };
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method;
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, false);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-newtarget.js
new file mode 100644
index 0000000000..dc0d0bbc0b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function-returns-newtarget.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-static-method.template
+/*---
+description: Async function returns an async function. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async method(x) {
+ return async function() { return new.target; };
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method;
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function.js b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function.js
new file mode 100644
index 0000000000..f33b386a7a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/returns-async-function.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function.case
+// - src/async-functions/evaluation/async-class-expr-static-method.template
+/*---
+description: Async function returns an async function. (Static async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async method(x) {
+ return async function() { return x; };
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method;
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method-static/shell.js b/js/src/tests/test262/language/expressions/class/async-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-method/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..b7af647a66
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/array-destructuring-param-strict-body.js
@@ -0,0 +1,136 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-meth.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..8b1ce1abc0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier-escaped.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async method() {
+ var \u0061wait;
+ }
+};
+
diff --git a/js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier.js
new file mode 100644
index 0000000000..18245342bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/await-as-binding-identifier.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier.case
+// - src/async-functions/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async method() {
+ var await;
+ }
+};
+
diff --git a/js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..6b4d3299cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference-escaped.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference-escaped.case
+// - src/async-functions/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async method() {
+ void \u0061wait;
+ }
+};
+
diff --git a/js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference.js
new file mode 100644
index 0000000000..54e6da546d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/await-as-identifier-reference.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference.case
+// - src/async-functions/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async method() {
+ void await;
+ }
+};
+
diff --git a/js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..208d403ff3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier-escaped.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async method() {
+ \u0061wait: ;
+ }
+};
+
diff --git a/js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier.js
new file mode 100644
index 0000000000..16b07d02fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/await-as-label-identifier.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier.case
+// - src/async-functions/syntax/async-class-expr-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async method() {
+ await: ;
+ }
+};
+
diff --git a/js/src/tests/test262/language/expressions/class/async-method/browser.js b/js/src/tests/test262/language/expressions/class/async-method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-abrupt.js
new file mode 100644
index 0000000000..b49a7a666a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-abrupt.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-async-meth.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method()
+ .then(_ => {
+ throw new Test262Error('function should not be resolved');
+ }, error => assert.sameValue(error.constructor, Test262Error))
+ .then(() => {
+ assert.sameValue(callCount, 0, 'function body is not evaluated');
+ }, $DONE)
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..b76112ea38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-async-meth.template
+/*---
+description: Use of initializer when argument value is not `undefined` (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ async method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(false, '', NaN, 0, null, obj).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..72a0151adb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-arg-val-undefined.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-async-meth.template
+/*---
+description: Use of initializer when argument value is `undefined` (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ async method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(undefined, void 0).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-duplicates.js
new file mode 100644
index 0000000000..eacab00cef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-duplicates.js
@@ -0,0 +1,65 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-async-meth.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-later.js
new file mode 100644
index 0000000000..5b2e2ace41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-later.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-async-meth.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+
+var callCount = 0;
+var C = class {
+ async method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method()
+ .then(_ => {
+ throw new Test262Error('function should not be resolved');
+ }, error => assert.sameValue(error.constructor, ReferenceError))
+ .then(() => {
+ assert.sameValue(callCount, 0, 'function body is not evaluated');
+ }, $DONE)
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..1cbbad4cf2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-prior.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-async-meth.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ async method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(3).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-self.js
new file mode 100644
index 0000000000..56c75ea73e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-ref-self.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-async-meth.template
+/*---
+description: Referencing a parameter from within its own initializer (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+
+var callCount = 0;
+var C = class {
+ async method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method()
+ .then(_ => {
+ throw new Test262Error('function should not be resolved');
+ }, error => assert.sameValue(error.constructor, ReferenceError))
+ .then(() => {
+ assert.sameValue(callCount, 0, 'function body is not evaluated');
+ }, $DONE)
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-rest.js
new file mode 100644
index 0000000000..06a5ef0c87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-rest.js
@@ -0,0 +1,69 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-async-meth.template
+/*---
+description: RestParameter does not support an initializer (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..814e03ac10
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/dflt-params-trailing-comma.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-async-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ async method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(42, undefined, 1).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..408fd2c230
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-meth.template
+/*---
+description: Forbidden extension, f.arguments (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..3523c1ef45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/cls-expr-async-meth-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..4607ba6fb0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+
+var callCount = 0;
+var C = class {
+ async method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.prototype.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..242ff4e296
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+
+var callCount = 0;
+var C = class {
+ async method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.prototype.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..ae362e3dfc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/cls-expr-async-meth-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+
+var callCount = 0;
+var C = class {
+ async method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.prototype.method()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-method/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-method/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..2979b86fdc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/object-destructuring-param-strict-body.js
@@ -0,0 +1,136 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-meth.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..e9c1b0f949
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-multiple.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-async-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ async method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(42, 39, 1).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 2, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-single.js
new file mode 100644
index 0000000000..7faeb4c183
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/params-trailing-comma-single.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-async-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ async method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(42, 39).then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-method/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-method/rest-param-strict-body.js
new file mode 100644
index 0000000000..98b538a8e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/rest-param-strict-body.js
@@ -0,0 +1,136 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-meth.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/async-method/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..9f74868b17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,61 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-async-meth.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression async method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
+ let strict be false.
+ 4. Let scope be the LexicalEnvironment of the running execution context.
+ 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
+ scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+var C = class {
+ static async method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-arguments-from-parent-function.js b/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-arguments-from-parent-function.js
new file mode 100644
index 0000000000..d330274e5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-arguments-from-parent-function.js
@@ -0,0 +1,42 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-arguments-from-parent-function.case
+// - src/async-functions/evaluation/async-class-expr-method.template
+/*---
+description: Async function returns an async function. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async method(x) {
+ let a = arguments;
+ return async () => a === arguments;
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, true);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-newtarget.js
new file mode 100644
index 0000000000..4ae8b1dcaf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow-returns-newtarget.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-method.template
+/*---
+description: Async function returns an async function. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async method(x) {
+ return async () => new.target;
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow.js b/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow.js
new file mode 100644
index 0000000000..850f97912a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/returns-async-arrow.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow.case
+// - src/async-functions/evaluation/async-class-expr-method.template
+/*---
+description: Async function returns an async function. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async method(x) {
+ return async () => x;
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-arguments-from-own-function.js b/js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-arguments-from-own-function.js
new file mode 100644
index 0000000000..592cfd9dd8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-arguments-from-own-function.js
@@ -0,0 +1,42 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-arguments-from-own-function.case
+// - src/async-functions/evaluation/async-class-expr-method.template
+/*---
+description: Async function returns an async function. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async method(x) {
+ let a = arguments;
+ return async function() { return a === arguments; };
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, false);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-newtarget.js
new file mode 100644
index 0000000000..46733654f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/returns-async-function-returns-newtarget.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-method.template
+/*---
+description: Async function returns an async function. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async method(x) {
+ return async function() { return new.target; };
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/returns-async-function.js b/js/src/tests/test262/language/expressions/class/async-method/returns-async-function.js
new file mode 100644
index 0000000000..a5b3e51d1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/returns-async-function.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function.case
+// - src/async-functions/evaluation/async-class-expr-method.template
+/*---
+description: Async function returns an async function. (Async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async method(x) {
+ return async function() { return x; };
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-method/shell.js b/js/src/tests/test262/language/expressions/class/async-method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/browser.js b/js/src/tests/test262/language/expressions/class/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped-module.js b/js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped-module.js
new file mode 100644
index 0000000000..c415466c7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped-module.js
@@ -0,0 +1,24 @@
+// |reftest| error:SyntaxError module
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `await` with escape sequence is a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module
+ and the StringValue of IdentifierName is "await".
+negative:
+ phase: parse
+ type: SyntaxError
+flags: [module]
+---*/
+
+$DONOTEVALUATE();
+
+var C = class aw\u0061it {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped.js b/js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped.js
new file mode 100644
index 0000000000..c00751058e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-await-escaped.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `await` with escape sequence is a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module
+ and the StringValue of IdentifierName is "await".
+---*/
+
+var C = class aw\u0061it {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-await-module.js b/js/src/tests/test262/language/expressions/class/class-name-ident-await-module.js
new file mode 100644
index 0000000000..ff38027189
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-await-module.js
@@ -0,0 +1,23 @@
+// |reftest| error:SyntaxError module
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `await` is a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ IdentifierReference : yield
+
+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module.
+negative:
+ phase: parse
+ type: SyntaxError
+flags: [module]
+---*/
+
+$DONOTEVALUATE();
+
+var C = class await {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-await.js b/js/src/tests/test262/language/expressions/class/class-name-ident-await.js
new file mode 100644
index 0000000000..648334a6db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-await.js
@@ -0,0 +1,18 @@
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `await` is a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ IdentifierReference : yield
+
+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module.
+---*/
+
+var C = class await {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-let-escaped.js b/js/src/tests/test262/language/expressions/class/class-name-ident-let-escaped.js
new file mode 100644
index 0000000000..6722efe6bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-let-escaped.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `let` with escape sequence is not a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if this phrase is contained in strict mode code and the
+ StringValue of IdentifierName is: "implements", "interface", "let", "package",
+ "private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class l\u0065t {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-let.js b/js/src/tests/test262/language/expressions/class/class-name-ident-let.js
new file mode 100644
index 0000000000..5d4978aab8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-let.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `let` is not a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if this phrase is contained in strict mode code and the
+ StringValue of IdentifierName is: "implements", "interface", "let", "package",
+ "private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class let {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-static-escaped.js b/js/src/tests/test262/language/expressions/class/class-name-ident-static-escaped.js
new file mode 100644
index 0000000000..6f7b69d2b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-static-escaped.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `static` with escape sequence is not a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if this phrase is contained in strict mode code and the
+ StringValue of IdentifierName is: "implements", "interface", "let", "package",
+ "private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class st\u0061tic {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-static.js b/js/src/tests/test262/language/expressions/class/class-name-ident-static.js
new file mode 100644
index 0000000000..9dafac4fd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-static.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `static` is not a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if this phrase is contained in strict mode code and the
+ StringValue of IdentifierName is: "implements", "interface", "let", "package",
+ "private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class static {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-yield-escaped.js b/js/src/tests/test262/language/expressions/class/class-name-ident-yield-escaped.js
new file mode 100644
index 0000000000..19d27ec86c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-yield-escaped.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `yield` with escape sequence is not a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ Identifier : IdentifierName but not ReservedWord
+
+ It is a Syntax Error if this phrase is contained in strict mode code and the
+ StringValue of IdentifierName is: "implements", "interface", "let", "package",
+ "private", "protected", "public", "static", or "yield".
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class yi\u0065ld {};
diff --git a/js/src/tests/test262/language/expressions/class/class-name-ident-yield.js b/js/src/tests/test262/language/expressions/class/class-name-ident-yield.js
new file mode 100644
index 0000000000..fd7264a75b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/class-name-ident-yield.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions
+description: >
+ `yield` is not a valid class-name identifier.
+info: |
+ 12.1.1 Static Semantics: Early Errors
+
+ IdentifierReference : yield
+
+ It is a Syntax Error if the code matched by this production is contained in strict mode code.
+
+ 10.2.1 Strict Mode Code
+
+ All parts of a ClassDeclaration or a ClassExpression are strict mode code.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class yield {};
diff --git a/js/src/tests/test262/language/expressions/class/constructor-this-tdz-during-initializers.js b/js/src/tests/test262/language/expressions/class/constructor-this-tdz-during-initializers.js
new file mode 100644
index 0000000000..65a4dd0e7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/constructor-this-tdz-during-initializers.js
@@ -0,0 +1,45 @@
+// Copyright (C) 2018 Kevin Gibbons. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-super-keyword-runtime-semantics-evaluation
+description: >
+ `this` is bound in the constructor of derived classes immediately before running initializers
+info: |
+ [...]
+ 6. Let result be ? Construct(func, argList, newTarget).
+ [...]
+ 10. Perform ? thisER.BindThisValue(result).
+ 11. Perform ? InitializeInstanceFields(result, F).
+ [...]
+features: [class-fields-public]
+---*/
+
+
+var probeCtorThis;
+var thisDuringField;
+var thisFromProbe;
+var thisDuringCtor;
+
+class Base {
+ constructor() {
+ assert.throws(ReferenceError, probeCtorThis);
+ }
+}
+
+var C = class extends Base {
+ field = (thisDuringField = this, thisFromProbe = probeCtorThis());
+ constructor() {
+ probeCtorThis = () => this;
+ assert.throws(ReferenceError, probeCtorThis);
+ super();
+ thisDuringCtor = this;
+ }
+};
+
+var instance = new C();
+
+assert.sameValue(thisDuringField, instance);
+assert.sameValue(thisFromProbe, instance);
+assert.sameValue(thisDuringCtor, instance);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-add.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-add.js
new file mode 100644
index 0000000000..cad3fa9558
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-add.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-add.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1 + 1]() {
+ return 2;
+ }
+
+ set [1 + 1](v) {
+ return 2;
+ }
+
+ static get [1 + 1]() {
+ return 2;
+ }
+
+ static set [1 + 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 1],
+ 2
+);
+assert.sameValue(
+ c[1 + 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[1 + 1],
+ 2
+);
+assert.sameValue(
+ C[1 + 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(1 + 1)],
+ 2
+);
+assert.sameValue(
+ c[String(1 + 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(1 + 1)],
+ 2
+);
+assert.sameValue(
+ C[String(1 + 1)] = 2,
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-subtract.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-subtract.js
new file mode 100644
index 0000000000..8b3a6539bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-additive-expression-subtract.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1 - 1]() {
+ return 0;
+ }
+
+ set [1 - 1](v) {
+ return 0;
+ }
+
+ static get [1 - 1]() {
+ return 0;
+ }
+
+ static set [1 - 1](v) {
+ return 0;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 - 1],
+ 0
+);
+assert.sameValue(
+ c[1 - 1] = 0,
+ 0
+);
+
+assert.sameValue(
+ C[1 - 1],
+ 0
+);
+assert.sameValue(
+ C[1 - 1] = 0,
+ 0
+);
+assert.sameValue(
+ c[String(1 - 1)],
+ 0
+);
+assert.sameValue(
+ c[String(1 - 1)] = 0,
+ 0
+);
+
+assert.sameValue(
+ C[String(1 - 1)],
+ 0
+);
+assert.sameValue(
+ C[String(1 - 1)] = 0,
+ 0
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-arrow-function-expression.js
new file mode 100644
index 0000000000..1dbc5ad5a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-arrow-function-expression.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from arrow function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [() => { }]() {
+ return 1;
+ }
+
+ set [() => { }](v) {
+ return 1;
+ }
+
+ static get [() => { }]() {
+ return 1;
+ }
+
+ static set [() => { }](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[() => { }],
+ 1
+);
+assert.sameValue(
+ c[() => { }] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[() => { }],
+ 1
+);
+assert.sameValue(
+ C[() => { }] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(() => { })],
+ 1
+);
+assert.sameValue(
+ c[String(() => { })] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(() => { })],
+ 1
+);
+assert.sameValue(
+ C[String(() => { })] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-assignment.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-assignment.js
new file mode 100644
index 0000000000..39a00589d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-assignment.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ get [x = 1]() {
+ return 2;
+ }
+
+ set [x = 1](v) {
+ return 2;
+ }
+
+ static get [x = 1]() {
+ return 2;
+ }
+
+ static set [x = 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x = 1],
+ 2
+);
+assert.sameValue(
+ c[x = 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x = 1],
+ 2
+);
+assert.sameValue(
+ C[x = 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x = 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x = 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x = 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x = 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-bitwise-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-bitwise-or.js
new file mode 100644
index 0000000000..b7e140ffe2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-bitwise-or.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ get [x |= 1]() {
+ return 2;
+ }
+
+ set [x |= 1](v) {
+ return 2;
+ }
+
+ static get [x |= 1]() {
+ return 2;
+ }
+
+ static set [x |= 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x |= 1],
+ 2
+);
+assert.sameValue(
+ c[x |= 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x |= 1],
+ 2
+);
+assert.sameValue(
+ C[x |= 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x |= 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x |= 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x |= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x |= 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-coalesce.js
new file mode 100644
index 0000000000..d71ffc2e2a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-coalesce.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = null;
+
+
+let C = class {
+ get [x ??= 1]() {
+ return 2;
+ }
+
+ set [x ??= 1](v) {
+ return 2;
+ }
+
+ static get [x ??= 1]() {
+ return 2;
+ }
+
+ static set [x ??= 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ??= 1],
+ 2
+);
+assert.sameValue(
+ c[x ??= 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x ??= 1],
+ 2
+);
+assert.sameValue(
+ C[x ??= 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x ??= 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x ??= 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x ??= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x ??= 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-and.js
new file mode 100644
index 0000000000..56bb7711f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-and.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ get [x &&= 1]() {
+ return 2;
+ }
+
+ set [x &&= 1](v) {
+ return 2;
+ }
+
+ static get [x &&= 1]() {
+ return 2;
+ }
+
+ static set [x &&= 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x &&= 1],
+ 2
+);
+assert.sameValue(
+ c[x &&= 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x &&= 1],
+ 2
+);
+assert.sameValue(
+ C[x &&= 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x &&= 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x &&= 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x &&= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x &&= 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-or.js
new file mode 100644
index 0000000000..9905fadac2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-assignment-expression-logical-or.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ get [x ||= 1]() {
+ return 2;
+ }
+
+ set [x ||= 1](v) {
+ return 2;
+ }
+
+ static get [x ||= 1]() {
+ return 2;
+ }
+
+ static set [x ||= 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ||= 1],
+ 2
+);
+assert.sameValue(
+ c[x ||= 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x ||= 1],
+ 2
+);
+assert.sameValue(
+ C[x ||= 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x ||= 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x ||= 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x ||= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x ||= 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-async-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-async-arrow-function-expression.js
new file mode 100644
index 0000000000..b13dcd3423
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-async-arrow-function-expression.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [async () => {}]() {
+ return 1;
+ }
+
+ set [async () => {}](v) {
+ return 1;
+ }
+
+ static get [async () => {}]() {
+ return 1;
+ }
+
+ static set [async () => {}](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[async () => {}],
+ 1
+);
+assert.sameValue(
+ c[async () => {}] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[async () => {}],
+ 1
+);
+assert.sameValue(
+ C[async () => {}] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(async () => {})],
+ 1
+);
+assert.sameValue(
+ c[String(async () => {})] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(async () => {})],
+ 1
+);
+assert.sameValue(
+ C[String(async () => {})] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js
new file mode 100644
index 0000000000..030ba3bde0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-await-expression.js
@@ -0,0 +1,98 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-await-expression.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, top-level-await]
+flags: [generated, async, module]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+try {
+
+
+let C = class {
+ get [await 9]() {
+ return 9;
+ }
+
+ set [await 9](v) {
+ return 9;
+ }
+
+ static get [await 9]() {
+ return 9;
+ }
+
+ static set [await 9](v) {
+ return 9;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[await 9],
+ 9
+);
+assert.sameValue(
+ c[await 9] = 9,
+ 9
+);
+
+assert.sameValue(
+ C[await 9],
+ 9
+);
+assert.sameValue(
+ C[await 9] = 9,
+ 9
+);
+assert.sameValue(
+ c[String(await 9)],
+ 9
+);
+assert.sameValue(
+ c[String(await 9)] = 9,
+ 9
+);
+
+assert.sameValue(
+ C[String(await 9)],
+ 9
+);
+assert.sameValue(
+ C[String(await 9)] = 9,
+ 9
+);
+
+} catch (e) {
+ $DONE(e);
+}
+$DONE();
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-false.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-false.js
new file mode 100644
index 0000000000..9f1a2b3688
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-false.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-false.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [false ? 1 : 2]() {
+ return 1;
+ }
+
+ set [false ? 1 : 2](v) {
+ return 1;
+ }
+
+ static get [false ? 1 : 2]() {
+ return 1;
+ }
+
+ static set [false ? 1 : 2](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[false ? 1 : 2],
+ 1
+);
+assert.sameValue(
+ c[false ? 1 : 2] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[false ? 1 : 2],
+ 1
+);
+assert.sameValue(
+ C[false ? 1 : 2] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(false ? 1 : 2)],
+ 1
+);
+assert.sameValue(
+ c[String(false ? 1 : 2)] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(false ? 1 : 2)],
+ 1
+);
+assert.sameValue(
+ C[String(false ? 1 : 2)] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-true.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-true.js
new file mode 100644
index 0000000000..8d4558ef2a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-condition-expression-true.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-true.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [true ? 1 : 2]() {
+ return 2;
+ }
+
+ set [true ? 1 : 2](v) {
+ return 2;
+ }
+
+ static get [true ? 1 : 2]() {
+ return 2;
+ }
+
+ static set [true ? 1 : 2](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[true ? 1 : 2],
+ 2
+);
+assert.sameValue(
+ c[true ? 1 : 2] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[true ? 1 : 2],
+ 2
+);
+assert.sameValue(
+ C[true ? 1 : 2] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(true ? 1 : 2)],
+ 2
+);
+assert.sameValue(
+ c[String(true ? 1 : 2)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(true ? 1 : 2)],
+ 2
+);
+assert.sameValue(
+ C[String(true ? 1 : 2)] = 2,
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-e-notational-literal.js
new file mode 100644
index 0000000000..5f803ff042
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-e-notational-literal.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1.e1]() {
+ return 2;
+ }
+
+ set [1.e1](v) {
+ return 2;
+ }
+
+ static get [1.e1]() {
+ return 2;
+ }
+
+ static set [1.e1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.e1],
+ 2
+);
+assert.sameValue(
+ c[1.e1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[1.e1],
+ 2
+);
+assert.sameValue(
+ C[1.e1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(1.e1)],
+ 2
+);
+assert.sameValue(
+ c[String(1.e1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(1.e1)],
+ 2
+);
+assert.sameValue(
+ C[String(1.e1)] = 2,
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-literal.js
new file mode 100644
index 0000000000..09aa45c82f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-decimal-literal.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-literal.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1.1]() {
+ return 2;
+ }
+
+ set [1.1](v) {
+ return 2;
+ }
+
+ static get [1.1]() {
+ return 2;
+ }
+
+ static set [1.1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.1],
+ 2
+);
+assert.sameValue(
+ c[1.1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[1.1],
+ 2
+);
+assert.sameValue(
+ C[1.1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(1.1)],
+ 2
+);
+assert.sameValue(
+ c[String(1.1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(1.1)],
+ 2
+);
+assert.sameValue(
+ C[String(1.1)] = 2,
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-exponetiation-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-exponetiation-expression.js
new file mode 100644
index 0000000000..f1622bc932
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-exponetiation-expression.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [2 ** 2]() {
+ return 4;
+ }
+
+ set [2 ** 2](v) {
+ return 4;
+ }
+
+ static get [2 ** 2]() {
+ return 4;
+ }
+
+ static set [2 ** 2](v) {
+ return 4;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[2 ** 2],
+ 4
+);
+assert.sameValue(
+ c[2 ** 2] = 4,
+ 4
+);
+
+assert.sameValue(
+ C[2 ** 2],
+ 4
+);
+assert.sameValue(
+ C[2 ** 2] = 4,
+ 4
+);
+assert.sameValue(
+ c[String(2 ** 2)],
+ 4
+);
+assert.sameValue(
+ c[String(2 ** 2)] = 4,
+ 4
+);
+
+assert.sameValue(
+ C[String(2 ** 2)],
+ 4
+);
+assert.sameValue(
+ C[String(2 ** 2)] = 4,
+ 4
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-coalesce.js
new file mode 100644
index 0000000000..9891658650
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-coalesce.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x;
+
+
+let C = class {
+ get [x ?? 1]() {
+ return 2;
+ }
+
+ set [x ?? 1](v) {
+ return 2;
+ }
+
+ static get [x ?? 1]() {
+ return 2;
+ }
+
+ static set [x ?? 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ?? 1],
+ 2
+);
+assert.sameValue(
+ c[x ?? 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x ?? 1],
+ 2
+);
+assert.sameValue(
+ C[x ?? 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x ?? 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x ?? 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x ?? 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x ?? 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-and.js
new file mode 100644
index 0000000000..b65b5b52d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-and.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ get [x && 1]() {
+ return 2;
+ }
+
+ set [x && 1](v) {
+ return 2;
+ }
+
+ static get [x && 1]() {
+ return 2;
+ }
+
+ static set [x && 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x && 1],
+ 2
+);
+assert.sameValue(
+ c[x && 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x && 1],
+ 2
+);
+assert.sameValue(
+ C[x && 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x && 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x && 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x && 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x && 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-or.js
new file mode 100644
index 0000000000..75ef13c9cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-expression-logical-or.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ get [x || 1]() {
+ return 2;
+ }
+
+ set [x || 1](v) {
+ return 2;
+ }
+
+ static get [x || 1]() {
+ return 2;
+ }
+
+ static set [x || 1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x || 1],
+ 2
+);
+assert.sameValue(
+ c[x || 1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[x || 1],
+ 2
+);
+assert.sameValue(
+ C[x || 1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(x || 1)],
+ 2
+);
+assert.sameValue(
+ c[String(x || 1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(x || 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x || 1)] = 2,
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-declaration.js
new file mode 100644
index 0000000000..5428d230ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-declaration.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function f() {}
+
+
+let C = class {
+ get [f()]() {
+ return 1;
+ }
+
+ set [f()](v) {
+ return 1;
+ }
+
+ static get [f()]() {
+ return 1;
+ }
+
+ static set [f()](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[f()],
+ 1
+);
+assert.sameValue(
+ c[f()] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[f()],
+ 1
+);
+assert.sameValue(
+ C[f()] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(f())],
+ 1
+);
+assert.sameValue(
+ c[String(f())] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(f())],
+ 1
+);
+assert.sameValue(
+ C[String(f())] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-expression.js
new file mode 100644
index 0000000000..465c48a11c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-function-expression.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [function () {}]() {
+ return 1;
+ }
+
+ set [function () {}](v) {
+ return 1;
+ }
+
+ static get [function () {}]() {
+ return 1;
+ }
+
+ static set [function () {}](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[function () {}],
+ 1
+);
+assert.sameValue(
+ c[function () {}] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[function () {}],
+ 1
+);
+assert.sameValue(
+ C[function () {}] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(function () {})],
+ 1
+);
+assert.sameValue(
+ c[String(function () {})] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(function () {})],
+ 1
+);
+assert.sameValue(
+ C[String(function () {})] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-generator-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-generator-function-declaration.js
new file mode 100644
index 0000000000..1cc99c7ca7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-generator-function-declaration.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from generator function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() { return 1; }
+
+
+let C = class {
+ get [g()]() {
+ return 1;
+ }
+
+ set [g()](v) {
+ return 1;
+ }
+
+ static get [g()]() {
+ return 1;
+ }
+
+ static set [g()](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[g()],
+ 1
+);
+assert.sameValue(
+ c[g()] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[g()],
+ 1
+);
+assert.sameValue(
+ C[g()] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(g())],
+ 1
+);
+assert.sameValue(
+ c[String(g())] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(g())],
+ 1
+);
+assert.sameValue(
+ C[String(g())] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-identifier.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-identifier.js
new file mode 100644
index 0000000000..bebf3d4980
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-identifier.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-identifier.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 1;
+
+
+
+let C = class {
+ get [x]() {
+ return '2';
+ }
+
+ set [x](v) {
+ return '2';
+ }
+
+ static get [x]() {
+ return '2';
+ }
+
+ static set [x](v) {
+ return '2';
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x],
+ '2'
+);
+assert.sameValue(
+ c[x] = '2',
+ '2'
+);
+
+assert.sameValue(
+ C[x],
+ '2'
+);
+assert.sameValue(
+ C[x] = '2',
+ '2'
+);
+assert.sameValue(
+ c[String(x)],
+ '2'
+);
+assert.sameValue(
+ c[String(x)] = '2',
+ '2'
+);
+
+assert.sameValue(
+ C[String(x)],
+ '2'
+);
+assert.sameValue(
+ C[String(x)] = '2',
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-e-notational-literal.js
new file mode 100644
index 0000000000..78cf62812d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-e-notational-literal.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1]() {
+ return 2;
+ }
+
+ set [1](v) {
+ return 2;
+ }
+
+ static get [1]() {
+ return 2;
+ }
+
+ static set [1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1],
+ 2
+);
+assert.sameValue(
+ c[1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[1],
+ 2
+);
+assert.sameValue(
+ C[1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(1)],
+ 2
+);
+assert.sameValue(
+ c[String(1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(1)],
+ 2
+);
+assert.sameValue(
+ C[String(1)] = 2,
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-separators.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-separators.js
new file mode 100644
index 0000000000..15232db802
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-integer-separators.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-separators.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1_2_3_4_5_6_7_8]() {
+ return 1_2_3_4_5_6_7_8;
+ }
+
+ set [1_2_3_4_5_6_7_8](v) {
+ return 1_2_3_4_5_6_7_8;
+ }
+
+ static get [1_2_3_4_5_6_7_8]() {
+ return 1_2_3_4_5_6_7_8;
+ }
+
+ static set [1_2_3_4_5_6_7_8](v) {
+ return 1_2_3_4_5_6_7_8;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1_2_3_4_5_6_7_8],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ c[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8,
+ 1_2_3_4_5_6_7_8
+);
+
+assert.sameValue(
+ C[1_2_3_4_5_6_7_8],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8,
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ c[String(1_2_3_4_5_6_7_8)],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ c[String(1_2_3_4_5_6_7_8)] = 1_2_3_4_5_6_7_8,
+ 1_2_3_4_5_6_7_8
+);
+
+assert.sameValue(
+ C[String(1_2_3_4_5_6_7_8)],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[String(1_2_3_4_5_6_7_8)] = 1_2_3_4_5_6_7_8,
+ 1_2_3_4_5_6_7_8
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-math.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-math.js
new file mode 100644
index 0000000000..c52e448e06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-math.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-math.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from math (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1 + 2 - 3 * 4 / 5 ** 6]() {
+ return 2.999232;
+ }
+
+ set [1 + 2 - 3 * 4 / 5 ** 6](v) {
+ return 2.999232;
+ }
+
+ static get [1 + 2 - 3 * 4 / 5 ** 6]() {
+ return 2.999232;
+ }
+
+ static set [1 + 2 - 3 * 4 / 5 ** 6](v) {
+ return 2.999232;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 2 - 3 * 4 / 5 ** 6],
+ 2.999232
+);
+assert.sameValue(
+ c[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232,
+ 2.999232
+);
+
+assert.sameValue(
+ C[1 + 2 - 3 * 4 / 5 ** 6],
+ 2.999232
+);
+assert.sameValue(
+ C[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232,
+ 2.999232
+);
+assert.sameValue(
+ c[String(1 + 2 - 3 * 4 / 5 ** 6)],
+ 2.999232
+);
+assert.sameValue(
+ c[String(1 + 2 - 3 * 4 / 5 ** 6)] = 2.999232,
+ 2.999232
+);
+
+assert.sameValue(
+ C[String(1 + 2 - 3 * 4 / 5 ** 6)],
+ 2.999232
+);
+assert.sameValue(
+ C[String(1 + 2 - 3 * 4 / 5 ** 6)] = 2.999232,
+ 2.999232
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-div.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-div.js
new file mode 100644
index 0000000000..058d62a4aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-div.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1 / 1]() {
+ return 1;
+ }
+
+ set [1 / 1](v) {
+ return 1;
+ }
+
+ static get [1 / 1]() {
+ return 1;
+ }
+
+ static set [1 / 1](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 / 1],
+ 1
+);
+assert.sameValue(
+ c[1 / 1] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[1 / 1],
+ 1
+);
+assert.sameValue(
+ C[1 / 1] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(1 / 1)],
+ 1
+);
+assert.sameValue(
+ c[String(1 / 1)] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(1 / 1)],
+ 1
+);
+assert.sameValue(
+ C[String(1 / 1)] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-mult.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-mult.js
new file mode 100644
index 0000000000..98e3b23fef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-multiplicative-expression-mult.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1 * 1]() {
+ return 1;
+ }
+
+ set [1 * 1](v) {
+ return 1;
+ }
+
+ static get [1 * 1]() {
+ return 1;
+ }
+
+ static set [1 * 1](v) {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 * 1],
+ 1
+);
+assert.sameValue(
+ c[1 * 1] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[1 * 1],
+ 1
+);
+assert.sameValue(
+ C[1 * 1] = 1,
+ 1
+);
+assert.sameValue(
+ c[String(1 * 1)],
+ 1
+);
+assert.sameValue(
+ c[String(1 * 1)] = 1,
+ 1
+);
+
+assert.sameValue(
+ C[String(1 * 1)],
+ 1
+);
+assert.sameValue(
+ C[String(1 * 1)] = 1,
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-null.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-null.js
new file mode 100644
index 0000000000..1e99677ef3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-null.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-null.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [null]() {
+ return null;
+ }
+
+ set [null](v) {
+ return null;
+ }
+
+ static get [null]() {
+ return null;
+ }
+
+ static set [null](v) {
+ return null;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[null],
+ null
+);
+assert.sameValue(
+ c[null] = null,
+ null
+);
+
+assert.sameValue(
+ C[null],
+ null
+);
+assert.sameValue(
+ C[null] = null,
+ null
+);
+assert.sameValue(
+ c[String(null)],
+ null
+);
+assert.sameValue(
+ c[String(null)] = null,
+ null
+);
+
+assert.sameValue(
+ C[String(null)],
+ null
+);
+assert.sameValue(
+ C[String(null)] = null,
+ null
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-numeric-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-numeric-literal.js
new file mode 100644
index 0000000000..f5dfd70d29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-numeric-literal.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-numeric-literal.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get [1]() {
+ return 2;
+ }
+
+ set [1](v) {
+ return 2;
+ }
+
+ static get [1]() {
+ return 2;
+ }
+
+ static set [1](v) {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1],
+ 2
+);
+assert.sameValue(
+ c[1] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[1],
+ 2
+);
+assert.sameValue(
+ C[1] = 2,
+ 2
+);
+assert.sameValue(
+ c[String(1)],
+ 2
+);
+assert.sameValue(
+ c[String(1)] = 2,
+ 2
+);
+
+assert.sameValue(
+ C[String(1)],
+ 2
+);
+assert.sameValue(
+ C[String(1)] = 2,
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-string-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-string-literal.js
new file mode 100644
index 0000000000..838a6d9878
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-string-literal.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-string-literal.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ get ['1']() {
+ return '2';
+ }
+
+ set ['1'](v) {
+ return '2';
+ }
+
+ static get ['1']() {
+ return '2';
+ }
+
+ static set ['1'](v) {
+ return '2';
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c['1'],
+ '2'
+);
+assert.sameValue(
+ c['1'] = '2',
+ '2'
+);
+
+assert.sameValue(
+ C['1'],
+ '2'
+);
+assert.sameValue(
+ C['1'] = '2',
+ '2'
+);
+assert.sameValue(
+ c[String('1')],
+ '2'
+);
+assert.sameValue(
+ c[String('1')] = '2',
+ '2'
+);
+
+assert.sameValue(
+ C[String('1')],
+ '2'
+);
+assert.sameValue(
+ C[String('1')] = '2',
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-yield-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-yield-expression.js
new file mode 100644
index 0000000000..16f20273dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-accessors-computed-property-name-from-yield-expression.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-yield-expression.case
+// - src/computed-property-names/evaluation/class-expression-accessors.template
+/*---
+description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() {
+
+
+let C = class {
+ get [yield 9]() {
+ return 9;
+ }
+
+ set [yield 9](v) {
+ return 9;
+ }
+
+ static get [yield 9]() {
+ return 9;
+ }
+
+ static set [yield 9](v) {
+ return 9;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[yield 9],
+ 9
+);
+assert.sameValue(
+ c[yield 9] = 9,
+ 9
+);
+
+assert.sameValue(
+ C[yield 9],
+ 9
+);
+assert.sameValue(
+ C[yield 9] = 9,
+ 9
+);
+assert.sameValue(
+ c[String(yield 9)],
+ 9
+);
+assert.sameValue(
+ c[String(yield 9)] = 9,
+ 9
+);
+
+assert.sameValue(
+ C[String(yield 9)],
+ 9
+);
+assert.sameValue(
+ C[String(yield 9)] = 9,
+ 9
+);
+
+}
+var iter = g();
+while (iter.next().done === false) ;
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-add.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-add.js
new file mode 100644
index 0000000000..32507b3d9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-add.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-add.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 + 1]() {
+ return 2;
+ }
+ static [1 + 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 1](),
+ 2
+);
+assert.sameValue(
+ C[1 + 1](),
+ 2
+);
+assert.sameValue(
+ c[String(1 + 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1 + 1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-subtract.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-subtract.js
new file mode 100644
index 0000000000..7339113312
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-additive-expression-subtract.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 - 1]() {
+ return 0;
+ }
+ static [1 - 1]() {
+ return 0;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 - 1](),
+ 0
+);
+assert.sameValue(
+ C[1 - 1](),
+ 0
+);
+assert.sameValue(
+ c[String(1 - 1)](),
+ 0
+);
+assert.sameValue(
+ C[String(1 - 1)](),
+ 0
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-arrow-function-expression.js
new file mode 100644
index 0000000000..d72ea03384
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-arrow-function-expression.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from arrow function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [() => { }]() {
+ return 1;
+ }
+ static [() => { }]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[() => { }](),
+ 1
+);
+assert.sameValue(
+ C[() => { }](),
+ 1
+);
+assert.sameValue(
+ c[String(() => { })](),
+ 1
+);
+assert.sameValue(
+ C[String(() => { })](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-assignment.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-assignment.js
new file mode 100644
index 0000000000..338cf06696
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-assignment.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x = 1]() {
+ return 2;
+ }
+ static [x = 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x = 1](),
+ 2
+);
+assert.sameValue(
+ C[x = 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x = 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x = 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-bitwise-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-bitwise-or.js
new file mode 100644
index 0000000000..b04b5a821c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-bitwise-or.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x |= 1]() {
+ return 2;
+ }
+ static [x |= 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x |= 1](),
+ 2
+);
+assert.sameValue(
+ C[x |= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x |= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x |= 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-coalesce.js
new file mode 100644
index 0000000000..5ef5ba0b7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-coalesce.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = null;
+
+
+let C = class {
+ [x ??= 1]() {
+ return 2;
+ }
+ static [x ??= 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ??= 1](),
+ 2
+);
+assert.sameValue(
+ C[x ??= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x ??= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x ??= 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-and.js
new file mode 100644
index 0000000000..7b989a77cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-and.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x &&= 1]() {
+ return 2;
+ }
+ static [x &&= 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x &&= 1](),
+ 2
+);
+assert.sameValue(
+ C[x &&= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x &&= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x &&= 1)](),
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-or.js
new file mode 100644
index 0000000000..a12ad1b16e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-assignment-expression-logical-or.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x ||= 1]() {
+ return 2;
+ }
+ static [x ||= 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ||= 1](),
+ 2
+);
+assert.sameValue(
+ C[x ||= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x ||= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x ||= 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-async-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-async-arrow-function-expression.js
new file mode 100644
index 0000000000..3f78c77cc4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-async-arrow-function-expression.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [async () => {}]() {
+ return 1;
+ }
+ static [async () => {}]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[async () => {}](),
+ 1
+);
+assert.sameValue(
+ C[async () => {}](),
+ 1
+);
+assert.sameValue(
+ c[String(async () => {})](),
+ 1
+);
+assert.sameValue(
+ C[String(async () => {})](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js
new file mode 100644
index 0000000000..5228718199
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-await-expression.js
@@ -0,0 +1,71 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-await-expression.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, top-level-await]
+flags: [generated, async, module]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+try {
+
+
+let C = class {
+ [await 9]() {
+ return 9;
+ }
+ static [await 9]() {
+ return 9;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[await 9](),
+ 9
+);
+assert.sameValue(
+ C[await 9](),
+ 9
+);
+assert.sameValue(
+ c[String(await 9)](),
+ 9
+);
+assert.sameValue(
+ C[String(await 9)](),
+ 9
+);
+
+} catch (e) {
+ $DONE(e);
+}
+$DONE();
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-false.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-false.js
new file mode 100644
index 0000000000..f56c4284ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-false.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-false.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [false ? 1 : 2]() {
+ return 1;
+ }
+ static [false ? 1 : 2]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[false ? 1 : 2](),
+ 1
+);
+assert.sameValue(
+ C[false ? 1 : 2](),
+ 1
+);
+assert.sameValue(
+ c[String(false ? 1 : 2)](),
+ 1
+);
+assert.sameValue(
+ C[String(false ? 1 : 2)](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-true.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-true.js
new file mode 100644
index 0000000000..059a06c9d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-condition-expression-true.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-true.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [true ? 1 : 2]() {
+ return 2;
+ }
+ static [true ? 1 : 2]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[true ? 1 : 2](),
+ 2
+);
+assert.sameValue(
+ C[true ? 1 : 2](),
+ 2
+);
+assert.sameValue(
+ c[String(true ? 1 : 2)](),
+ 2
+);
+assert.sameValue(
+ C[String(true ? 1 : 2)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-e-notational-literal.js
new file mode 100644
index 0000000000..676eaf3381
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-e-notational-literal.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1.e1]() {
+ return 2;
+ }
+ static [1.e1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.e1](),
+ 2
+);
+assert.sameValue(
+ C[1.e1](),
+ 2
+);
+assert.sameValue(
+ c[String(1.e1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1.e1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-literal.js
new file mode 100644
index 0000000000..3b1dcf9b4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-decimal-literal.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-literal.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1.1]() {
+ return 2;
+ }
+ static [1.1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.1](),
+ 2
+);
+assert.sameValue(
+ C[1.1](),
+ 2
+);
+assert.sameValue(
+ c[String(1.1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1.1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-exponetiation-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-exponetiation-expression.js
new file mode 100644
index 0000000000..1e1ee5dbbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-exponetiation-expression.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [2 ** 2]() {
+ return 4;
+ }
+ static [2 ** 2]() {
+ return 4;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[2 ** 2](),
+ 4
+);
+assert.sameValue(
+ C[2 ** 2](),
+ 4
+);
+assert.sameValue(
+ c[String(2 ** 2)](),
+ 4
+);
+assert.sameValue(
+ C[String(2 ** 2)](),
+ 4
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-coalesce.js
new file mode 100644
index 0000000000..37c4aa2c1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-coalesce.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x;
+
+
+let C = class {
+ [x ?? 1]() {
+ return 2;
+ }
+ static [x ?? 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ?? 1](),
+ 2
+);
+assert.sameValue(
+ C[x ?? 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x ?? 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x ?? 1)](),
+ 2
+);
+
+assert.sameValue(x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-and.js
new file mode 100644
index 0000000000..2f28795886
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-and.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x && 1]() {
+ return 2;
+ }
+ static [x && 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x && 1](),
+ 2
+);
+assert.sameValue(
+ C[x && 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x && 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x && 1)](),
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-or.js
new file mode 100644
index 0000000000..a227327d49
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-expression-logical-or.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x || 1]() {
+ return 2;
+ }
+ static [x || 1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x || 1](),
+ 2
+);
+assert.sameValue(
+ C[x || 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x || 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x || 1)](),
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-declaration.js
new file mode 100644
index 0000000000..e19d9f710a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-declaration.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function f() {}
+
+
+let C = class {
+ [f()]() {
+ return 1;
+ }
+ static [f()]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[f()](),
+ 1
+);
+assert.sameValue(
+ C[f()](),
+ 1
+);
+assert.sameValue(
+ c[String(f())](),
+ 1
+);
+assert.sameValue(
+ C[String(f())](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-expression.js
new file mode 100644
index 0000000000..1db086873e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-function-expression.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-expression.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [function () {}]() {
+ return 1;
+ }
+ static [function () {}]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[function () {}](),
+ 1
+);
+assert.sameValue(
+ C[function () {}](),
+ 1
+);
+assert.sameValue(
+ c[String(function () {})](),
+ 1
+);
+assert.sameValue(
+ C[String(function () {})](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-generator-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-generator-function-declaration.js
new file mode 100644
index 0000000000..c22bb8d401
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-generator-function-declaration.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from generator function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() { return 1; }
+
+
+let C = class {
+ [g()]() {
+ return 1;
+ }
+ static [g()]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[g()](),
+ 1
+);
+assert.sameValue(
+ C[g()](),
+ 1
+);
+assert.sameValue(
+ c[String(g())](),
+ 1
+);
+assert.sameValue(
+ C[String(g())](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-identifier.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-identifier.js
new file mode 100644
index 0000000000..3ad568777a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-identifier.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-identifier.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 1;
+
+
+
+let C = class {
+ [x]() {
+ return '2';
+ }
+ static [x]() {
+ return '2';
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x](),
+ '2'
+);
+assert.sameValue(
+ C[x](),
+ '2'
+);
+assert.sameValue(
+ c[String(x)](),
+ '2'
+);
+assert.sameValue(
+ C[String(x)](),
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-e-notational-literal.js
new file mode 100644
index 0000000000..e264963316
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-e-notational-literal.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1]() {
+ return 2;
+ }
+ static [1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1](),
+ 2
+);
+assert.sameValue(
+ C[1](),
+ 2
+);
+assert.sameValue(
+ c[String(1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-separators.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-separators.js
new file mode 100644
index 0000000000..f02e174591
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-integer-separators.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-separators.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1_2_3_4_5_6_7_8]() {
+ return 1_2_3_4_5_6_7_8;
+ }
+ static [1_2_3_4_5_6_7_8]() {
+ return 1_2_3_4_5_6_7_8;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1_2_3_4_5_6_7_8](),
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[1_2_3_4_5_6_7_8](),
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ c[String(1_2_3_4_5_6_7_8)](),
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[String(1_2_3_4_5_6_7_8)](),
+ 1_2_3_4_5_6_7_8
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-math.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-math.js
new file mode 100644
index 0000000000..9d6a4495d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-math.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-math.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from math (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 + 2 - 3 * 4 / 5 ** 6]() {
+ return 2.999232;
+ }
+ static [1 + 2 - 3 * 4 / 5 ** 6]() {
+ return 2.999232;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 2 - 3 * 4 / 5 ** 6](),
+ 2.999232
+);
+assert.sameValue(
+ C[1 + 2 - 3 * 4 / 5 ** 6](),
+ 2.999232
+);
+assert.sameValue(
+ c[String(1 + 2 - 3 * 4 / 5 ** 6)](),
+ 2.999232
+);
+assert.sameValue(
+ C[String(1 + 2 - 3 * 4 / 5 ** 6)](),
+ 2.999232
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-div.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-div.js
new file mode 100644
index 0000000000..440768f97c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-div.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 / 1]() {
+ return 1;
+ }
+ static [1 / 1]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 / 1](),
+ 1
+);
+assert.sameValue(
+ C[1 / 1](),
+ 1
+);
+assert.sameValue(
+ c[String(1 / 1)](),
+ 1
+);
+assert.sameValue(
+ C[String(1 / 1)](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-mult.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-mult.js
new file mode 100644
index 0000000000..8b7b7ace37
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-multiplicative-expression-mult.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 * 1]() {
+ return 1;
+ }
+ static [1 * 1]() {
+ return 1;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 * 1](),
+ 1
+);
+assert.sameValue(
+ C[1 * 1](),
+ 1
+);
+assert.sameValue(
+ c[String(1 * 1)](),
+ 1
+);
+assert.sameValue(
+ C[String(1 * 1)](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-null.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-null.js
new file mode 100644
index 0000000000..5ea2af315c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-null.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-null.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [null]() {
+ return null;
+ }
+ static [null]() {
+ return null;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[null](),
+ null
+);
+assert.sameValue(
+ C[null](),
+ null
+);
+assert.sameValue(
+ c[String(null)](),
+ null
+);
+assert.sameValue(
+ C[String(null)](),
+ null
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-numeric-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-numeric-literal.js
new file mode 100644
index 0000000000..443e05cba8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-numeric-literal.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-numeric-literal.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1]() {
+ return 2;
+ }
+ static [1]() {
+ return 2;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1](),
+ 2
+);
+assert.sameValue(
+ C[1](),
+ 2
+);
+assert.sameValue(
+ c[String(1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-string-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-string-literal.js
new file mode 100644
index 0000000000..8e1497d162
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-string-literal.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-string-literal.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ ['1']() {
+ return '2';
+ }
+ static ['1']() {
+ return '2';
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c['1'](),
+ '2'
+);
+assert.sameValue(
+ C['1'](),
+ '2'
+);
+assert.sameValue(
+ c[String('1')](),
+ '2'
+);
+assert.sameValue(
+ C[String('1')](),
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-yield-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-yield-expression.js
new file mode 100644
index 0000000000..95a9f1a3b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-computed-property-name-from-yield-expression.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-yield-expression.case
+// - src/computed-property-names/evaluation/class-expression.template
+/*---
+description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() {
+
+
+let C = class {
+ [yield 9]() {
+ return 9;
+ }
+ static [yield 9]() {
+ return 9;
+ }
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[yield 9](),
+ 9
+);
+assert.sameValue(
+ C[yield 9](),
+ 9
+);
+assert.sameValue(
+ c[String(yield 9)](),
+ 9
+);
+assert.sameValue(
+ C[String(yield 9)](),
+ 9
+);
+
+}
+var iter = g();
+while (iter.next().done === false) ;
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-add.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-add.js
new file mode 100644
index 0000000000..2bf2ac51c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-add.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-add.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 + 1] = 2;
+
+ static [1 + 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 1],
+ 2
+);
+assert.sameValue(
+ C[1 + 1],
+ 2
+);
+assert.sameValue(
+ c[String(1 + 1)],
+ 2
+);
+assert.sameValue(
+ C[String(1 + 1)],
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-subtract.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-subtract.js
new file mode 100644
index 0000000000..492b73ef19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-additive-expression-subtract.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 - 1] = 0;
+
+ static [1 - 1] = 0;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 - 1],
+ 0
+);
+assert.sameValue(
+ C[1 - 1],
+ 0
+);
+assert.sameValue(
+ c[String(1 - 1)],
+ 0
+);
+assert.sameValue(
+ C[String(1 - 1)],
+ 0
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-arrow-function-expression.js
new file mode 100644
index 0000000000..6af478d2d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-arrow-function-expression.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from arrow function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [() => { }] = 1;
+
+ static [() => { }] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[() => { }],
+ 1
+);
+assert.sameValue(
+ C[() => { }],
+ 1
+);
+assert.sameValue(
+ c[String(() => { })],
+ 1
+);
+assert.sameValue(
+ C[String(() => { })],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-assignment.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-assignment.js
new file mode 100644
index 0000000000..edb9dd5d0d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-assignment.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x = 1] = 2;
+
+ static [x = 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x = 1],
+ 2
+);
+assert.sameValue(
+ C[x = 1],
+ 2
+);
+assert.sameValue(
+ c[String(x = 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x = 1)],
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-bitwise-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-bitwise-or.js
new file mode 100644
index 0000000000..13029cd9ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-bitwise-or.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x |= 1] = 2;
+
+ static [x |= 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x |= 1],
+ 2
+);
+assert.sameValue(
+ C[x |= 1],
+ 2
+);
+assert.sameValue(
+ c[String(x |= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x |= 1)],
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-coalesce.js
new file mode 100644
index 0000000000..0fd1ec8b87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-coalesce.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = null;
+
+
+let C = class {
+ [x ??= 1] = 2;
+
+ static [x ??= 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ??= 1],
+ 2
+);
+assert.sameValue(
+ C[x ??= 1],
+ 2
+);
+assert.sameValue(
+ c[String(x ??= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x ??= 1)],
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-and.js
new file mode 100644
index 0000000000..d517e2d8e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-and.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x &&= 1] = 2;
+
+ static [x &&= 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x &&= 1],
+ 2
+);
+assert.sameValue(
+ C[x &&= 1],
+ 2
+);
+assert.sameValue(
+ c[String(x &&= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x &&= 1)],
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-or.js
new file mode 100644
index 0000000000..9708b849c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-assignment-expression-logical-or.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x ||= 1] = 2;
+
+ static [x ||= 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ||= 1],
+ 2
+);
+assert.sameValue(
+ C[x ||= 1],
+ 2
+);
+assert.sameValue(
+ c[String(x ||= 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x ||= 1)],
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-async-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-async-arrow-function-expression.js
new file mode 100644
index 0000000000..243fc29867
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-async-arrow-function-expression.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [async () => {}] = 1;
+
+ static [async () => {}] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[async () => {}],
+ 1
+);
+assert.sameValue(
+ C[async () => {}],
+ 1
+);
+assert.sameValue(
+ c[String(async () => {})],
+ 1
+);
+assert.sameValue(
+ C[String(async () => {})],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js
new file mode 100644
index 0000000000..180fb5d566
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-await-expression.js
@@ -0,0 +1,68 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-await-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, top-level-await, class-fields-public, class-static-fields-public]
+flags: [generated, async, module]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+try {
+
+
+let C = class {
+ [await 9] = 9;
+
+ static [await 9] = 9;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[await 9],
+ 9
+);
+assert.sameValue(
+ C[await 9],
+ 9
+);
+assert.sameValue(
+ c[String(await 9)],
+ 9
+);
+assert.sameValue(
+ C[String(await 9)],
+ 9
+);
+
+} catch (e) {
+ $DONE(e);
+}
+$DONE();
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-false.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-false.js
new file mode 100644
index 0000000000..a11f7edbac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-false.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-false.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [false ? 1 : 2] = 1;
+
+ static [false ? 1 : 2] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[false ? 1 : 2],
+ 1
+);
+assert.sameValue(
+ C[false ? 1 : 2],
+ 1
+);
+assert.sameValue(
+ c[String(false ? 1 : 2)],
+ 1
+);
+assert.sameValue(
+ C[String(false ? 1 : 2)],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-true.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-true.js
new file mode 100644
index 0000000000..2f63cf80d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-condition-expression-true.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-true.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [true ? 1 : 2] = 2;
+
+ static [true ? 1 : 2] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[true ? 1 : 2],
+ 2
+);
+assert.sameValue(
+ C[true ? 1 : 2],
+ 2
+);
+assert.sameValue(
+ c[String(true ? 1 : 2)],
+ 2
+);
+assert.sameValue(
+ C[String(true ? 1 : 2)],
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-e-notational-literal.js
new file mode 100644
index 0000000000..591bc11d40
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-e-notational-literal.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1.e1] = 2;
+
+ static [1.e1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.e1],
+ 2
+);
+assert.sameValue(
+ C[1.e1],
+ 2
+);
+assert.sameValue(
+ c[String(1.e1)],
+ 2
+);
+assert.sameValue(
+ C[String(1.e1)],
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-literal.js
new file mode 100644
index 0000000000..3b77383ce4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-decimal-literal.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1.1] = 2;
+
+ static [1.1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.1],
+ 2
+);
+assert.sameValue(
+ C[1.1],
+ 2
+);
+assert.sameValue(
+ c[String(1.1)],
+ 2
+);
+assert.sameValue(
+ C[String(1.1)],
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-exponetiation-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-exponetiation-expression.js
new file mode 100644
index 0000000000..8904d0a705
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-exponetiation-expression.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [2 ** 2] = 4;
+
+ static [2 ** 2] = 4;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[2 ** 2],
+ 4
+);
+assert.sameValue(
+ C[2 ** 2],
+ 4
+);
+assert.sameValue(
+ c[String(2 ** 2)],
+ 4
+);
+assert.sameValue(
+ C[String(2 ** 2)],
+ 4
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-coalesce.js
new file mode 100644
index 0000000000..5b4e59ed4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-coalesce.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x;
+
+
+let C = class {
+ [x ?? 1] = 2;
+
+ static [x ?? 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ?? 1],
+ 2
+);
+assert.sameValue(
+ C[x ?? 1],
+ 2
+);
+assert.sameValue(
+ c[String(x ?? 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x ?? 1)],
+ 2
+);
+
+assert.sameValue(x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-and.js
new file mode 100644
index 0000000000..132af6f79b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-and.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x && 1] = 2;
+
+ static [x && 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x && 1],
+ 2
+);
+assert.sameValue(
+ C[x && 1],
+ 2
+);
+assert.sameValue(
+ c[String(x && 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x && 1)],
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-or.js
new file mode 100644
index 0000000000..53c41bfeeb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-expression-logical-or.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x || 1] = 2;
+
+ static [x || 1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x || 1],
+ 2
+);
+assert.sameValue(
+ C[x || 1],
+ 2
+);
+assert.sameValue(
+ c[String(x || 1)],
+ 2
+);
+assert.sameValue(
+ C[String(x || 1)],
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-declaration.js
new file mode 100644
index 0000000000..b5cbbf355e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-declaration.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function f() {}
+
+
+let C = class {
+ [f()] = 1;
+
+ static [f()] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[f()],
+ 1
+);
+assert.sameValue(
+ C[f()],
+ 1
+);
+assert.sameValue(
+ c[String(f())],
+ 1
+);
+assert.sameValue(
+ C[String(f())],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-expression.js
new file mode 100644
index 0000000000..0f45ff274f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-function-expression.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [function () {}] = 1;
+
+ static [function () {}] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[function () {}],
+ 1
+);
+assert.sameValue(
+ C[function () {}],
+ 1
+);
+assert.sameValue(
+ c[String(function () {})],
+ 1
+);
+assert.sameValue(
+ C[String(function () {})],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-generator-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-generator-function-declaration.js
new file mode 100644
index 0000000000..0bf066e59d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-generator-function-declaration.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from generator function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() { return 1; }
+
+
+let C = class {
+ [g()] = 1;
+
+ static [g()] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[g()],
+ 1
+);
+assert.sameValue(
+ C[g()],
+ 1
+);
+assert.sameValue(
+ c[String(g())],
+ 1
+);
+assert.sameValue(
+ C[String(g())],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-identifier.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-identifier.js
new file mode 100644
index 0000000000..e817da824f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-identifier.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-identifier.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 1;
+
+
+
+let C = class {
+ [x] = '2';
+
+ static [x] = '2';
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x],
+ '2'
+);
+assert.sameValue(
+ C[x],
+ '2'
+);
+assert.sameValue(
+ c[String(x)],
+ '2'
+);
+assert.sameValue(
+ C[String(x)],
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-e-notational-literal.js
new file mode 100644
index 0000000000..20aa9fe5a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-e-notational-literal.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1] = 2;
+
+ static [1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1],
+ 2
+);
+assert.sameValue(
+ C[1],
+ 2
+);
+assert.sameValue(
+ c[String(1)],
+ 2
+);
+assert.sameValue(
+ C[String(1)],
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-separators.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-separators.js
new file mode 100644
index 0000000000..656fa24a75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-integer-separators.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-separators.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8;
+
+ static [1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1_2_3_4_5_6_7_8],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[1_2_3_4_5_6_7_8],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ c[String(1_2_3_4_5_6_7_8)],
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[String(1_2_3_4_5_6_7_8)],
+ 1_2_3_4_5_6_7_8
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-math.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-math.js
new file mode 100644
index 0000000000..dc3b42ec3f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-math.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-math.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from math (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232;
+
+ static [1 + 2 - 3 * 4 / 5 ** 6] = 2.999232;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 2 - 3 * 4 / 5 ** 6],
+ 2.999232
+);
+assert.sameValue(
+ C[1 + 2 - 3 * 4 / 5 ** 6],
+ 2.999232
+);
+assert.sameValue(
+ c[String(1 + 2 - 3 * 4 / 5 ** 6)],
+ 2.999232
+);
+assert.sameValue(
+ C[String(1 + 2 - 3 * 4 / 5 ** 6)],
+ 2.999232
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-div.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-div.js
new file mode 100644
index 0000000000..959c8c443c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-div.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 / 1] = 1;
+
+ static [1 / 1] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 / 1],
+ 1
+);
+assert.sameValue(
+ C[1 / 1],
+ 1
+);
+assert.sameValue(
+ c[String(1 / 1)],
+ 1
+);
+assert.sameValue(
+ C[String(1 / 1)],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-mult.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-mult.js
new file mode 100644
index 0000000000..5930a4316d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-multiplicative-expression-mult.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 * 1] = 1;
+
+ static [1 * 1] = 1;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 * 1],
+ 1
+);
+assert.sameValue(
+ C[1 * 1],
+ 1
+);
+assert.sameValue(
+ c[String(1 * 1)],
+ 1
+);
+assert.sameValue(
+ C[String(1 * 1)],
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-null.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-null.js
new file mode 100644
index 0000000000..3a37bf8f34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-null.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-null.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [null] = null;
+
+ static [null] = null;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[null],
+ null
+);
+assert.sameValue(
+ C[null],
+ null
+);
+assert.sameValue(
+ c[String(null)],
+ null
+);
+assert.sameValue(
+ C[String(null)],
+ null
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-numeric-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-numeric-literal.js
new file mode 100644
index 0000000000..569db4b6d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-numeric-literal.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-numeric-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1] = 2;
+
+ static [1] = 2;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1],
+ 2
+);
+assert.sameValue(
+ C[1],
+ 2
+);
+assert.sameValue(
+ c[String(1)],
+ 2
+);
+assert.sameValue(
+ C[String(1)],
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-string-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-string-literal.js
new file mode 100644
index 0000000000..d44e0a28d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-string-literal.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-string-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ ['1'] = '2';
+
+ static ['1'] = '2';
+};
+
+let c = new C();
+
+assert.sameValue(
+ c['1'],
+ '2'
+);
+assert.sameValue(
+ C['1'],
+ '2'
+);
+assert.sameValue(
+ c[String('1')],
+ '2'
+);
+assert.sameValue(
+ C[String('1')],
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-yield-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-yield-expression.js
new file mode 100644
index 0000000000..303614d03d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-computed-property-name-from-yield-expression.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-yield-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields.template
+/*---
+description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() {
+
+
+let C = class {
+ [yield 9] = 9;
+
+ static [yield 9] = 9;
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[yield 9],
+ 9
+);
+assert.sameValue(
+ C[yield 9],
+ 9
+);
+assert.sameValue(
+ c[String(yield 9)],
+ 9
+);
+assert.sameValue(
+ C[String(yield 9)],
+ 9
+);
+
+}
+var iter = g();
+while (iter.next().done === false) ;
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-add.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-add.js
new file mode 100644
index 0000000000..037048a59d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-add.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-add.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from additive expression "add" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 + 1] = () => {
+ return 2;
+ };
+
+ static [1 + 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 1](),
+ 2
+);
+assert.sameValue(
+ C[1 + 1](),
+ 2
+);
+assert.sameValue(
+ c[String(1 + 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1 + 1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-subtract.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-subtract.js
new file mode 100644
index 0000000000..fd072f67ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-additive-expression-subtract.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from additive expression "subtract" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 - 1] = () => {
+ return 0;
+ };
+
+ static [1 - 1] = () => {
+ return 0;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 - 1](),
+ 0
+);
+assert.sameValue(
+ C[1 - 1](),
+ 0
+);
+assert.sameValue(
+ c[String(1 - 1)](),
+ 0
+);
+assert.sameValue(
+ C[String(1 - 1)](),
+ 0
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-arrow-function-expression.js
new file mode 100644
index 0000000000..030378c2fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-arrow-function-expression.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from arrow function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [() => { }] = () => {
+ return 1;
+ };
+
+ static [() => { }] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[() => { }](),
+ 1
+);
+assert.sameValue(
+ C[() => { }](),
+ 1
+);
+assert.sameValue(
+ c[String(() => { })](),
+ 1
+);
+assert.sameValue(
+ C[String(() => { })](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-assignment.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-assignment.js
new file mode 100644
index 0000000000..743232d73b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-assignment.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from assignment expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x = 1] = () => {
+ return 2;
+ };
+
+ static [x = 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x = 1](),
+ 2
+);
+assert.sameValue(
+ C[x = 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x = 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x = 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js
new file mode 100644
index 0000000000..dea79a9efd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-bitwise-or.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x |= 1] = () => {
+ return 2;
+ };
+
+ static [x |= 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x |= 1](),
+ 2
+);
+assert.sameValue(
+ C[x |= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x |= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x |= 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-coalesce.js
new file mode 100644
index 0000000000..1a329d8f7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-coalesce.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from assignment expression coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = null;
+
+
+let C = class {
+ [x ??= 1] = () => {
+ return 2;
+ };
+
+ static [x ??= 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ??= 1](),
+ 2
+);
+assert.sameValue(
+ C[x ??= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x ??= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x ??= 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-and.js
new file mode 100644
index 0000000000..5c0930729c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-and.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from assignment expression logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x &&= 1] = () => {
+ return 2;
+ };
+
+ static [x &&= 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x &&= 1](),
+ 2
+);
+assert.sameValue(
+ C[x &&= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x &&= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x &&= 1)](),
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-or.js
new file mode 100644
index 0000000000..64990fe26f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-assignment-expression-logical-or.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from assignment expression logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, logical-assignment-operators, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x ||= 1] = () => {
+ return 2;
+ };
+
+ static [x ||= 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ||= 1](),
+ 2
+);
+assert.sameValue(
+ C[x ||= 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x ||= 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x ||= 1)](),
+ 2
+);
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-async-arrow-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-async-arrow-function-expression.js
new file mode 100644
index 0000000000..daa39f22e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-async-arrow-function-expression.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [async () => {}] = () => {
+ return 1;
+ };
+
+ static [async () => {}] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[async () => {}](),
+ 1
+);
+assert.sameValue(
+ C[async () => {}](),
+ 1
+);
+assert.sameValue(
+ c[String(async () => {})](),
+ 1
+);
+assert.sameValue(
+ C[String(async () => {})](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js
new file mode 100644
index 0000000000..821c7b8d8a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js
@@ -0,0 +1,72 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-await-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, top-level-await, class-fields-public, class-static-fields-public]
+flags: [generated, async, module]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+try {
+
+
+let C = class {
+ [await 9] = () => {
+ return 9;
+ };
+
+ static [await 9] = () => {
+ return 9;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[await 9](),
+ 9
+);
+assert.sameValue(
+ C[await 9](),
+ 9
+);
+assert.sameValue(
+ c[String(await 9)](),
+ 9
+);
+assert.sameValue(
+ C[String(await 9)](),
+ 9
+);
+
+} catch (e) {
+ $DONE(e);
+}
+$DONE();
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-false.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-false.js
new file mode 100644
index 0000000000..aa638068ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-false.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-false.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [false ? 1 : 2] = () => {
+ return 1;
+ };
+
+ static [false ? 1 : 2] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[false ? 1 : 2](),
+ 1
+);
+assert.sameValue(
+ C[false ? 1 : 2](),
+ 1
+);
+assert.sameValue(
+ c[String(false ? 1 : 2)](),
+ 1
+);
+assert.sameValue(
+ C[String(false ? 1 : 2)](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-true.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-true.js
new file mode 100644
index 0000000000..ce74dc704a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-condition-expression-true.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-condition-expression-true.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [true ? 1 : 2] = () => {
+ return 2;
+ };
+
+ static [true ? 1 : 2] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[true ? 1 : 2](),
+ 2
+);
+assert.sameValue(
+ C[true ? 1 : 2](),
+ 2
+);
+assert.sameValue(
+ c[String(true ? 1 : 2)](),
+ 2
+);
+assert.sameValue(
+ C[String(true ? 1 : 2)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-e-notational-literal.js
new file mode 100644
index 0000000000..afc6d36883
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-e-notational-literal.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from decimal e notational literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1.e1] = () => {
+ return 2;
+ };
+
+ static [1.e1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.e1](),
+ 2
+);
+assert.sameValue(
+ C[1.e1](),
+ 2
+);
+assert.sameValue(
+ c[String(1.e1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1.e1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-literal.js
new file mode 100644
index 0000000000..339787a6f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-decimal-literal.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-decimal-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from decimal literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1.1] = () => {
+ return 2;
+ };
+
+ static [1.1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1.1](),
+ 2
+);
+assert.sameValue(
+ C[1.1](),
+ 2
+);
+assert.sameValue(
+ c[String(1.1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1.1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-exponetiation-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-exponetiation-expression.js
new file mode 100644
index 0000000000..c50b2889ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-exponetiation-expression.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from exponentiation expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [2 ** 2] = () => {
+ return 4;
+ };
+
+ static [2 ** 2] = () => {
+ return 4;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[2 ** 2](),
+ 4
+);
+assert.sameValue(
+ C[2 ** 2](),
+ 4
+);
+assert.sameValue(
+ c[String(2 ** 2)](),
+ 4
+);
+assert.sameValue(
+ C[String(2 ** 2)](),
+ 4
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-coalesce.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-coalesce.js
new file mode 100644
index 0000000000..66200170fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-coalesce.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-coalesce.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from coalesce (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x;
+
+
+let C = class {
+ [x ?? 1] = () => {
+ return 2;
+ };
+
+ static [x ?? 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x ?? 1](),
+ 2
+);
+assert.sameValue(
+ C[x ?? 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x ?? 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x ?? 1)](),
+ 2
+);
+
+assert.sameValue(x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-and.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-and.js
new file mode 100644
index 0000000000..4a756972a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-and.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-and.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from logical and (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x && 1] = () => {
+ return 2;
+ };
+
+ static [x && 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x && 1](),
+ 2
+);
+assert.sameValue(
+ C[x && 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x && 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x && 1)](),
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-or.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-or.js
new file mode 100644
index 0000000000..f4a3eec9f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-expression-logical-or.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-expression-logical-or.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from logical or (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 0;
+
+
+let C = class {
+ [x || 1] = () => {
+ return 2;
+ };
+
+ static [x || 1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x || 1](),
+ 2
+);
+assert.sameValue(
+ C[x || 1](),
+ 2
+);
+assert.sameValue(
+ c[String(x || 1)](),
+ 2
+);
+assert.sameValue(
+ C[String(x || 1)](),
+ 2
+);
+
+assert.sameValue(x, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-declaration.js
new file mode 100644
index 0000000000..73fb862845
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-declaration.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function f() {}
+
+
+let C = class {
+ [f()] = () => {
+ return 1;
+ };
+
+ static [f()] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[f()](),
+ 1
+);
+assert.sameValue(
+ C[f()](),
+ 1
+);
+assert.sameValue(
+ c[String(f())](),
+ 1
+);
+assert.sameValue(
+ C[String(f())](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-expression.js
new file mode 100644
index 0000000000..bebb15621d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-expression.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-function-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from function expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [function () {}] = () => {
+ return 1;
+ };
+
+ static [function () {}] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[function () {}](),
+ 1
+);
+assert.sameValue(
+ C[function () {}](),
+ 1
+);
+assert.sameValue(
+ c[String(function () {})](),
+ 1
+);
+assert.sameValue(
+ C[String(function () {})](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-generator-function-declaration.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-generator-function-declaration.js
new file mode 100644
index 0000000000..a651032e6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-generator-function-declaration.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from generator function (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() { return 1; }
+
+
+let C = class {
+ [g()] = () => {
+ return 1;
+ };
+
+ static [g()] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[g()](),
+ 1
+);
+assert.sameValue(
+ C[g()](),
+ 1
+);
+assert.sameValue(
+ c[String(g())](),
+ 1
+);
+assert.sameValue(
+ C[String(g())](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-identifier.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-identifier.js
new file mode 100644
index 0000000000..c7a0ed2740
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-identifier.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-identifier.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+let x = 1;
+
+
+
+let C = class {
+ [x] = () => {
+ return '2';
+ };
+
+ static [x] = () => {
+ return '2';
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[x](),
+ '2'
+);
+assert.sameValue(
+ C[x](),
+ '2'
+);
+assert.sameValue(
+ c[String(x)](),
+ '2'
+);
+assert.sameValue(
+ C[String(x)](),
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-e-notational-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-e-notational-literal.js
new file mode 100644
index 0000000000..d028f26c1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-e-notational-literal.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1] = () => {
+ return 2;
+ };
+
+ static [1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1](),
+ 2
+);
+assert.sameValue(
+ C[1](),
+ 2
+);
+assert.sameValue(
+ c[String(1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-separators.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-separators.js
new file mode 100644
index 0000000000..99c4ab9cf2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-integer-separators.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-integer-separators.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from integer with separators (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1_2_3_4_5_6_7_8] = () => {
+ return 1_2_3_4_5_6_7_8;
+ };
+
+ static [1_2_3_4_5_6_7_8] = () => {
+ return 1_2_3_4_5_6_7_8;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1_2_3_4_5_6_7_8](),
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[1_2_3_4_5_6_7_8](),
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ c[String(1_2_3_4_5_6_7_8)](),
+ 1_2_3_4_5_6_7_8
+);
+assert.sameValue(
+ C[String(1_2_3_4_5_6_7_8)](),
+ 1_2_3_4_5_6_7_8
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-math.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-math.js
new file mode 100644
index 0000000000..9a2fb42b74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-math.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-math.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from math (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, exponentiation, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 + 2 - 3 * 4 / 5 ** 6] = () => {
+ return 2.999232;
+ };
+
+ static [1 + 2 - 3 * 4 / 5 ** 6] = () => {
+ return 2.999232;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 + 2 - 3 * 4 / 5 ** 6](),
+ 2.999232
+);
+assert.sameValue(
+ C[1 + 2 - 3 * 4 / 5 ** 6](),
+ 2.999232
+);
+assert.sameValue(
+ c[String(1 + 2 - 3 * 4 / 5 ** 6)](),
+ 2.999232
+);
+assert.sameValue(
+ C[String(1 + 2 - 3 * 4 / 5 ** 6)](),
+ 2.999232
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-div.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-div.js
new file mode 100644
index 0000000000..386384b025
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-div.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 / 1] = () => {
+ return 1;
+ };
+
+ static [1 / 1] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 / 1](),
+ 1
+);
+assert.sameValue(
+ C[1 / 1](),
+ 1
+);
+assert.sameValue(
+ c[String(1 / 1)](),
+ 1
+);
+assert.sameValue(
+ C[String(1 / 1)](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-mult.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-mult.js
new file mode 100644
index 0000000000..2c7b636587
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-multiplicative-expression-mult.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1 * 1] = () => {
+ return 1;
+ };
+
+ static [1 * 1] = () => {
+ return 1;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1 * 1](),
+ 1
+);
+assert.sameValue(
+ C[1 * 1](),
+ 1
+);
+assert.sameValue(
+ c[String(1 * 1)](),
+ 1
+);
+assert.sameValue(
+ C[String(1 * 1)](),
+ 1
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-null.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-null.js
new file mode 100644
index 0000000000..7b04831bcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-null.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-null.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [null] = () => {
+ return null;
+ };
+
+ static [null] = () => {
+ return null;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[null](),
+ null
+);
+assert.sameValue(
+ C[null](),
+ null
+);
+assert.sameValue(
+ c[String(null)](),
+ null
+);
+assert.sameValue(
+ C[String(null)](),
+ null
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-numeric-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-numeric-literal.js
new file mode 100644
index 0000000000..540b298896
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-numeric-literal.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-numeric-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from numeric literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ [1] = () => {
+ return 2;
+ };
+
+ static [1] = () => {
+ return 2;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[1](),
+ 2
+);
+assert.sameValue(
+ C[1](),
+ 2
+);
+assert.sameValue(
+ c[String(1)](),
+ 2
+);
+assert.sameValue(
+ C[String(1)](),
+ 2
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-string-literal.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-string-literal.js
new file mode 100644
index 0000000000..04e8435be2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-string-literal.js
@@ -0,0 +1,67 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-string-literal.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from string literal (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+
+
+let C = class {
+ ['1'] = () => {
+ return '2';
+ };
+
+ static ['1'] = () => {
+ return '2';
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c['1'](),
+ '2'
+);
+assert.sameValue(
+ C['1'](),
+ '2'
+);
+assert.sameValue(
+ c[String('1')](),
+ '2'
+);
+assert.sameValue(
+ C[String('1')](),
+ '2'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-yield-expression.js b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-yield-expression.js
new file mode 100644
index 0000000000..2c2e82bf7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-yield-expression.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/computed-property-names/computed-property-name-from-yield-expression.case
+// - src/computed-property-names/evaluation/class-expression-fields-methods.template
+/*---
+description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
+esid: prod-ComputedPropertyName
+features: [computed-property-names, class-fields-public, class-static-fields-public]
+flags: [generated]
+info: |
+ ClassExpression:
+ classBindingIdentifier opt ClassTail
+
+ ClassTail:
+ ClassHeritage opt { ClassBody opt }
+
+ ClassBody:
+ ClassElementList
+
+ ClassElementList:
+ ClassElement
+
+ ClassElement:
+ MethodDefinition
+
+ MethodDefinition:
+ PropertyName ...
+ get PropertyName ...
+ set PropertyName ...
+
+ PropertyName:
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+---*/
+function * g() {
+
+
+let C = class {
+ [yield 9] = () => {
+ return 9;
+ };
+
+ static [yield 9] = () => {
+ return 9;
+ };
+};
+
+let c = new C();
+
+assert.sameValue(
+ c[yield 9](),
+ 9
+);
+assert.sameValue(
+ C[yield 9](),
+ 9
+);
+assert.sameValue(
+ c[String(yield 9)](),
+ 9
+);
+assert.sameValue(
+ C[String(yield 9)](),
+ 9
+);
+
+}
+var iter = g();
+while (iter.next().done === false) ;
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/browser.js b/js/src/tests/test262/language/expressions/class/decorator/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/shell.js b/js/src/tests/test262/language/expressions/class/decorator/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/browser.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/browser.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/decorator-member-expr-private-identifier.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/decorator-member-expr-private-identifier.js
new file mode 100644
index 0000000000..6a9be80515
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/decorator-member-expr-private-identifier.js
@@ -0,0 +1,56 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-member-expr-private-identifier.case
+// - src/decorator/syntax/class-valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class expression in class body.)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ DecoratorMemberExpression[Yield, Await] :
+ PrivateIdentifier
+
+ PrivateIdentifier ::
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #$() {}
+ static #_() {}
+ static #\u{6F}() {}
+ static #\u2118() {}
+ static #ZW_\u200C_NJ() {}
+ static #ZW_\u200D_J() {}
+ static #yield() {}
+ static #await() {}
+
+ static {
+ var C = @#$
+ @#_
+ @#\u{6F}
+ @#\u2118
+ @#ZW_\u200C_NJ
+ @#ZW_\u200D_J
+ @#yield
+ @#await class {}
+ }
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/shell.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/class-valid/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/shell.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/browser.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js
new file mode 100644
index 0000000000..556837a680
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js
@@ -0,0 +1,47 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-call-expr-identifier-reference-yield.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorCallExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ DecoratorCallExpression[Yield, Await] :
+ DecoratorMemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
+
+ DecoratorMemberExpression[Yield, Await] :
+ IdentifierReference[?Yield, ?Await]
+ PrivateIdentifier
+ DecoratorMemberExpression[?Yield, ?Await] . IdentifierName
+
+ IdentifierReference[Yield, Await] :
+ [~Yield] yield
+ ...
+
+---*/
+function decorator() {
+ return () => {};
+}
+var yield = decorator;
+
+
+
+var C = @yield() class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js
new file mode 100644
index 0000000000..b4cd073879
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js
@@ -0,0 +1,60 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-call-expr-identifier-reference.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorCallExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ DecoratorCallExpression[Yield, Await] :
+ DecoratorMemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
+
+ DecoratorMemberExpression[Yield, Await] :
+ IdentifierReference[?Yield, ?Await]
+ PrivateIdentifier
+ DecoratorMemberExpression[?Yield, ?Await] . IdentifierName
+
+ IdentifierReference[Yield, Await] :
+ Identifier
+ [~Yield] yield
+ [~Await] await
+
+---*/
+function decorator() {
+ return () => {};
+}
+var $ = decorator;
+var _ = decorator;
+var \u{6F} = decorator;
+var \u2118 = decorator;
+var ZW_\u200C_NJ = decorator;
+var ZW_\u200D_J = decorator;
+var await = decorator;
+
+
+
+var C = @$()
+@_()
+@\u{6F}()
+@\u2118()
+@ZW_\u200C_NJ()
+@ZW_\u200D_J()
+@await() class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js
new file mode 100644
index 0000000000..46bced2a81
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js
@@ -0,0 +1,53 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-member-expr-decorator-member-expr.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ DecoratorMemberExpression[Yield, Await] :
+ IdentifierReference[?Yield, ?Await]
+ PrivateIdentifier
+ DecoratorMemberExpression[?Yield, ?Await] . IdentifierName
+
+---*/
+let ns = {
+ $() {},
+ _() {},
+ \u{6F}() {},
+ \u2118() {},
+ ZW_\u200C_NJ() {},
+ ZW_\u200D_J() {},
+ yield() {},
+ await() {},
+}
+
+
+
+var C = @ns.$
+@ns._
+@ns.\u{6F}
+@ns.\u2118
+@ns.ZW_\u200C_NJ
+@ns.ZW_\u200D_J
+@ns.yield
+@ns.await class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js
new file mode 100644
index 0000000000..15cba8fd1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js
@@ -0,0 +1,36 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-member-expr-identifier-reference-yield.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ IdentifierReference[Yield, Await] :
+ [~Yield] yield
+ ...
+
+---*/
+function yield() {}
+
+
+
+var C = @yield class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js
new file mode 100644
index 0000000000..dc65669318
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js
@@ -0,0 +1,49 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-member-expr-identifier-reference.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ IdentifierReference[Yield, Await] :
+ Identifier
+ [~Yield] yield
+ [~Await] await
+
+---*/
+function $() {}
+function _() {}
+function \u{6F}() {}
+function \u2118() {}
+function ZW_\u200C_NJ() {}
+function ZW_\u200D_J() {}
+function await() {}
+
+
+
+var C = @$
+@_
+@\u{6F}
+@\u2118
+@ZW_\u200C_NJ
+@ZW_\u200D_J
+@await class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js
new file mode 100644
index 0000000000..ee38362308
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js
@@ -0,0 +1,54 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-parenthesized-expr-identifier-reference-yield.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorParenthesizedExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ DecoratorParenthesizedExpression[Yield, Await] :
+ ( Expression[+In, ?Yield, ?Await] )
+
+ PrimaryExpression[Yield, Await] :
+ this
+ IdentifierReference[?Yield, ?Await]
+ Literal
+ ArrayLiteral[?Yield, ?Await]
+ ObjectLiteral[?Yield, ?Await]
+ FunctionExpression
+ ClassExpression[?Yield, ?Await]
+ GeneratorExpression
+ AsyncFunctionExpression
+ AsyncGeneratorExpression
+ RegularExpressionLiteral
+ TemplateLiteral[?Yield, ?Await, ~Tagged]
+ CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
+
+ IdentifierReference[Yield, Await] :
+ [~Yield] yield
+ ...
+
+---*/
+function yield() {}
+
+
+
+var C = @(yield) class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js
new file mode 100644
index 0000000000..59d332d76b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js
@@ -0,0 +1,62 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/decorator/decorator-parenthesized-expr-identifier-reference.case
+// - src/decorator/syntax/valid/cls-expr-decorators-valid-syntax.template
+/*---
+description: Decorator @ DecoratorParenthesizedExpression (Valid syntax for decorator on class expression)
+esid: prod-ClassExpression
+features: [class, decorators]
+flags: [generated]
+info: |
+ ClassExpression[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await]opt ClassTail[?Yield, ?Await]
+
+ DecoratorList[Yield, Await] :
+ DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await]
+
+ Decorator[Yield, Await] :
+ @ DecoratorMemberExpression[?Yield, ?Await]
+ @ DecoratorParenthesizedExpression[?Yield, ?Await]
+ @ DecoratorCallExpression[?Yield, ?Await]
+
+ ...
+
+
+ DecoratorParenthesizedExpression[Yield, Await] :
+ ( Expression[+In, ?Yield, ?Await] )
+
+ PrimaryExpression[Yield, Await] :
+ this
+ IdentifierReference[?Yield, ?Await]
+ Literal
+ ArrayLiteral[?Yield, ?Await]
+ ObjectLiteral[?Yield, ?Await]
+ FunctionExpression
+ ClassExpression[?Yield, ?Await]
+ GeneratorExpression
+ AsyncFunctionExpression
+ AsyncGeneratorExpression
+ RegularExpressionLiteral
+ TemplateLiteral[?Yield, ?Await, ~Tagged]
+ CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
+
+---*/
+function $() {}
+function _() {}
+function \u{6F}() {}
+function \u2118() {}
+function ZW_\u200C_NJ() {}
+function ZW_\u200D_J() {}
+function await() {}
+
+
+
+var C = @($)
+@(_)
+@(\u{6F})
+@(\u2118)
+@(ZW_\u200C_NJ)
+@(ZW_\u200D_J)
+@(await) class {};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/shell.js b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/decorator/syntax/valid/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..20817838eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..9d57954342
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+
+var C = class {
+ async *method([x, y, z]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method([1, 2, 3]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..4b057a8083
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-get-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+
+var C = class {
+ async *method([x]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..0e7e3d5600
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..1e1431dbbc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-name-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..bc98e355cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..743db15320
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[7, 8, 9]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..65e1efb290
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..e338818946
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4ec8c2f1a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ async *method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..cd9d5fc265
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async *method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[23]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..3e4ad1d697
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ async *method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..7904f28b0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async *method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([values]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..14ffc5e63a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Nested array destructuring with a null value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+
+var C = class {
+ async *method([[x]]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..104e0c4c9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..7dea6c1ebc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..e5c01219ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..c7e8e7b87c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..3efa58de34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..2beb517227
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..1066b40947
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([,]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..2b940b035f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async *method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([null, 0, false, '']).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..efebaa5eaf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+
+var C = class {
+ async *method([x = (function() { throw new Test262Error(); })()]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method([undefined]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..7318a27337
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([undefined]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..b06294ee4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ async *method([ x = unresolvableReference ]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(ReferenceError, function() {
+ method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..6b7198ed56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..d0c9b898ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..c1ee4386eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+
+var C = class {
+ async *method([x]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..78afb47928
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..7c22cef99a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ async *method([x]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..69b545069e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..35a9ed75f4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..00f62c37e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([{ x: 11, y: 22, z: 33 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..0e82ce9513
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..7f3e09edd6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([{ u: 777, w: 888, y: 999 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..6da248dbe6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Nested object destructuring with a null value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ async *method([{ x }]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..58afbe191e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ async *method([{ x }]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..2e5b9fb4a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Elision accepts exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ async *method([,]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..2230892ef9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision-step-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+
+var C = class {
+ async *method([,]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..77e66873f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Elision advances iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..7303bde30a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async *method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..1e8420c35e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,91 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([3, 4, 5]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..0eab6fa1cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,97 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element containing an elision (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..70d8990878
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..8c2bfbc089
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element containing a rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..1656e4d8c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Lone rest element (direct binding) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..17c03b6247
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+
+var C = class {
+ async *method([, ...x]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..9928647ba4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ async *method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..8e58ac16da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..f4a615466f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+
+var C = class {
+ async *method([...x]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..a543d3c5e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ async *method([...x]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..d5e0d5b60d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Lone rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..6ec5424abd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..abf47ee5d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..df756bebfd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..20c8d58a7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..b80c957f87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..7c980fa41a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..26f6fb6db2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..ee122bd136
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([7, 8, 9]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..30341e94cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..9f6eb290a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+
+var C = class {
+ async *method([x, y, z] = [1, 2, 3]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..669abf2f25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+
+var C = class {
+ async *method([x] = iter) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..8eb2676c3e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..0291735418
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..8c4d62c58c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..84b5c80507
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..e85c809434
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..5948acd6f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..41c4ee9075
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ async *method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..7c7f6c9e6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async *method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..a73e4287af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ async *method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..2645f7707f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async *method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..7082a9370c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Nested array destructuring with a null value (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+
+var C = class {
+ async *method([[x]] = [null]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..c6a5e5d3a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..5e09c77eca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..793df094e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b4e8bc7a77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..180070272d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..2bf54480e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..89084a4ba2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..d8cae4dc56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async *method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..c4240f1016
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+
+var C = class {
+ async *method([x = (function() { throw new Test262Error(); })()] = [undefined]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..4a69fffd4f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..2fc880b2a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ async *method([ x = unresolvableReference ] = []) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(ReferenceError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..9dc9392eac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..8e305ecd52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..ab82f51ff2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+
+var C = class {
+ async *method([x] = g) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..1e192cf70f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..6246720943
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ async *method([x] = g) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..0dde0d2a74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..f828fd1c48
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..454d4ff41a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..9fcf78f5ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..2e02eb5f3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..96c465bc77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Nested object destructuring with a null value (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ async *method([{ x }] = [null]) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..773e9705a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ async *method([{ x }] = []) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..537ace8621
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ async *method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..ef86eb33f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+
+var C = class {
+ async *method([,] = iter) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..e387291367
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..2ddd5085ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async *method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..5f3e1ba6b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,91 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..de6bec6c3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,97 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..46599fe7f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..9349d85aee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..1296ab2336
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..0e420e6e8c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+
+var C = class {
+ async *method([, ...x] = iter) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..938ab811e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ async *method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..352fd95f66
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..1eb2361fad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+
+var C = class {
+ async *method([...x] = iter) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..6f92021154
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ async *method([...x] = iter) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..b43cb7e0eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Lone rest element (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..2591249fc6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..517cad0e7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..26abbe642c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..db9c27a109
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..779a3d4cff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..db9fb19969
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..02810ee827
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..a5a7d8fe94
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ async *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-null.js
new file mode 100644
index 0000000000..77d26c2115
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-null.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ async *method({} = null) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..a707a46b29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-init-undefined.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ async *method({} = undefined) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..bcd87b5630
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ async *method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..f230bb48b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ async *method({ poisoned } = poisonedProperty) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..54660677c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..42ae2a6611
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..168314d36c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..73d85b5388
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..2c86f8ca4e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..3c38afeb26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..f397043f6d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ x = thrower() } = {}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..ba2a05cb78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ async *method({ x = unresolvableReference } = {}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(ReferenceError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..09cfc5d977
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..959c0ce787
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ a, b = thrower(), c = ++initCount } = {}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..f2e02d1434
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..a618f9aeb0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..c347570076
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ async *method({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..7cb6b7a388
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..5745017c1a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ [thrower()]: x } = {}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..23842c18fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ async *method({ poisoned: x = ++initEvalCount } = poisonedProperty) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..419f9d3e2a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..cfa0d3bc6d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ x: y = thrower() } = {}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..7570ec046d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ async *method({ x: y = unresolvableReference } = {}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(ReferenceError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..71a24ef8fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..f1d21f8467
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..0340e1131d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..7c94907a71
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..5014f9f961
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..46d921c014
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ async *method({ w: { x, y, z } = undefined } = { }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..524bf952a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..9ff0c95049
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ async *method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..7f9371452b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ async *method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..6e2738ca8d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-null.js
new file mode 100644
index 0000000000..9a2c00512e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-null.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ async *method({}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-undefined.js
new file mode 100644
index 0000000000..a335224f4f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-init-undefined.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ async *method({}) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..bebf324cce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ async *method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..04f618c42d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ async *method({ poisoned }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..2dafd1cae9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..d385eab1e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b5022e0802
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..6662627f93
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..ba35babb16
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..51034283b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: null, x: 0, y: false, z: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..1049c0b8f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ x = thrower() }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..8696a4cbe0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ async *method({ x = unresolvableReference }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(ReferenceError, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..f820c40c1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..5116b89c80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-list-err.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ a, b = thrower(), c = ++initCount }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..9650a3bb5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..710d2483ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: [45] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..520cc10605
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ async *method({ w: [x, y, z] = [4, 5, 6] }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..ef4aa2ee93
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: [7, undefined, ] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..4effd38ca9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ [thrower()]: x }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..63d6929268
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ async *method({ poisoned: x = ++initEvalCount }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method(poisonedProperty);
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..9bc0b776dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ s: null, u: 0, w: false, y: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..77a79e5489
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ async *method({ x: y = thrower() }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..78a7744b86
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ async *method({ x: y = unresolvableReference }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(ReferenceError, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..cc4fa1a239
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..cb44fa3cd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..e0553fa92b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Binding as specified via property name and identifier (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..ed8e639c43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: undefined }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..f603c3f59a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..e73d9c0e7f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ async *method({ w: { x, y, z } = undefined }) {
+
+ }
+};
+
+var method = C.prototype.method;
+
+assert.throws(TypeError, function() {
+ method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..2c4efb09bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: { x: undefined, z: 7 } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..4ec0173b2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ async *method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ get v() { count++; return 2; } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..9040e33170
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ async *method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(o).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..2cbbe071d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth.template
+/*---
+description: Rest object contains just unextracted data (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async *method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({x: 1, y: 2, a: 5, b: 3}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..ba92e41f73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..a2bed75691
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+
+var C = class {
+ static async *method([x, y, z]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method([1, 2, 3]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..35d85649e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-get-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+
+var C = class {
+ static async *method([x]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..2c5e2cb0e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..c536e90e46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..b93f0c52fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..6ef6ed24dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[7, 8, 9]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..db92bd7253
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..b84dd94d6d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..0c989644fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..9bbbd3dfb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[23]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..8c7bf096da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..8c9ed274b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([values]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..daa550a75e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Nested array destructuring with a null value (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+
+var C = class {
+ static async *method([[x]]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..c3a9c315c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e3c83b1381
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..f4ffa83509
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..f3167a1bde
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..adbae01640
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..c9ec8391d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..0277647bdc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+C.method([,]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..992f342012
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async *method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([null, 0, false, '']).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..f5a44ca097
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+
+var C = class {
+ static async *method([x = (function() { throw new Test262Error(); })()]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method([undefined]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..2931108c51
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([undefined]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..fea47bf49c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ static async *method([ x = unresolvableReference ]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(ReferenceError, function() {
+ method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..53bae4046d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..c641873e99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..77144123ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+
+var C = class {
+ static async *method([x]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..edb383febe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..3c034b5d77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ static async *method([x]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..13670ea184
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..3d0fcf8674
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..bb0319a405
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([{ x: 11, y: 22, z: 33 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..4b34afbdbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..c128d7c6d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method([{ u: 777, w: 888, y: 999 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..a3b3725ea7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Nested object destructuring with a null value (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ static async *method([{ x }]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..8dfc6d0bda
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ static async *method([{ x }]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..ae4a90b0d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([,]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..11e472c5a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision-step-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+
+var C = class {
+ static async *method([,]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..ac4453820b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Elision advances iterator (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..da658794dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..2c0ee38ce6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,91 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([3, 4, 5]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..7e97b54844
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,97 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element containing an elision (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..12813d515c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..3ab056e5b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..6fe06c2556
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..4a56bc5ad2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+
+var C = class {
+ static async *method([, ...x]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..36d3a39917
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..14103a4f61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..ff15ff5658
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+
+var C = class {
+ static async *method([...x]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..4fc76be9e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ static async *method([...x]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..2d0e7f7685
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Lone rest element (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..0b56bf56e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..f7d87a533f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..93a27685ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..f9aa8720be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..ae7282ba95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..4ad94a6fb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..e63b6014a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..056c9c9a36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+C.method([7, 8, 9]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..5d357c5ccc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..a4c3eea3d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+
+var C = class {
+ static async *method([x, y, z] = [1, 2, 3]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..781a1f1249
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+
+var C = class {
+ static async *method([x] = iter) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..6399d666d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..aba5123a47
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..09bb801cd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..8c3ce4f902
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..c5c1270498
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..663fb2186f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..8bc5c6e1ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..a85ee9f382
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..a6c6fd144d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..2c264be49f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async *method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..08be76c9f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Nested array destructuring with a null value (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+
+var C = class {
+ static async *method([[x]] = [null]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..0810b0a09f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..241779cb41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..1300384217
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a82c0a7cc4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..784d8cdfcc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..e5fc7712f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..2dae116ded
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..180476ea3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async *method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..5796ed9912
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+
+var C = class {
+ static async *method([x = (function() { throw new Test262Error(); })()] = [undefined]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..7110e8663a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..3e642a9584
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ static async *method([ x = unresolvableReference ] = []) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(ReferenceError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..b858ec95e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..2ac76a7417
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..07d433def1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+
+var C = class {
+ static async *method([x] = g) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..71580b2647
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..6c014b5365
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ static async *method([x] = g) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..9584e0d248
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..4fa8a88688
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..b81d14d6a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..65b4f402d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..44b32e2ae2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..6e0af4053b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a null value (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ static async *method([{ x }] = [null]) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..9e0271ecc3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+
+var C = class {
+ static async *method([{ x }] = []) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..0877b06a6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..ca53775448
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+
+var C = class {
+ static async *method([,] = iter) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..fb4cee3499
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..752827bc53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..75510fa7c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,91 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..96b99cfccb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,97 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..b46b03f18e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..7492ed7f7a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..c8f98b7c4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..8ef48c4f25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+
+var C = class {
+ static async *method([, ...x] = iter) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..d60bf3e8c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..c964b64339
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..e0f36335aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+
+var C = class {
+ static async *method([...x] = iter) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..51764971a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+
+var C = class {
+ static async *method([...x] = iter) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..11ac4d4b2a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..06d05d327e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..4b34fd2252
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..749165fe4e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..25487bf1d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..042602ce26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..36fbd5cd56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..18247d2608
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..2ef2c3d9f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ static async *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-null.js
new file mode 100644
index 0000000000..72d6bfadef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-null.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ static async *method({} = null) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..b86e1b538a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-init-undefined.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ static async *method({} = undefined) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..1298b21fd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ static async *method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..8d12d840ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ static async *method({ poisoned } = poisonedProperty) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..8b46508a24
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..530655d8bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0d00ed1906
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..e7def649ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..1712cf7868
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..70b952ccf4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..7d0b364bf5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ x = thrower() } = {}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..4b26911f15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ static async *method({ x = unresolvableReference } = {}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(ReferenceError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..b57e3b15a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..c48ad1d8cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ a, b = thrower(), c = ++initCount } = {}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..a622c4bb2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..59d4a3cb36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..c981e9538d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ static async *method({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..e6d4976b1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..096a406423
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ [thrower()]: x } = {}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..91ad34ed23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ static async *method({ poisoned: x = ++initEvalCount } = poisonedProperty) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..33dcef1476
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..01022e6b4f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ x: y = thrower() } = {}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..c6f4897ce9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ static async *method({ x: y = unresolvableReference } = {}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(ReferenceError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..0ac539f55b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..3f459e247e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..e133896f4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..e506692c4e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..0eb24e673e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ static async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..2b59dfd129
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ static async *method({ w: { x, y, z } = undefined } = { }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..f3aacba2a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..5f2ae364ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async *method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..22f05012f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ static async *method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..ac1d1a3d20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-null.js
new file mode 100644
index 0000000000..97980621f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-null.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ static async *method({}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-undefined.js
new file mode 100644
index 0000000000..7504a2485a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-init-undefined.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+
+var C = class {
+ static async *method({}) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..e7a8630aa3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,68 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ static async *method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..be191318ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ static async *method({ poisoned }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e7467ce5cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..08aa15ffde
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..cd5d2730ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..11388418f4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..4ec0190329
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..14828b8913
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: null, x: 0, y: false, z: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..154bb2ed28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ x = thrower() }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..b0f7d1ea05
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ static async *method({ x = unresolvableReference }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(ReferenceError, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..63ea5d206a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..7773771d83
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-list-err.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ a, b = thrower(), c = ++initCount }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..a6716669f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..945d72329c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: [45] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..e56720ca6d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ static async *method({ w: [x, y, z] = [4, 5, 6] }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..93c9a95603
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: [7, undefined, ] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..2c9dfc8f54
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ [thrower()]: x }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..f555a23d02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+
+var C = class {
+ static async *method({ poisoned: x = ++initEvalCount }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method(poisonedProperty);
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..61d7153bb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ s: null, u: 0, w: false, y: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..288d1df44e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+
+var C = class {
+ static async *method({ x: y = thrower() }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(Test262Error, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..9e76bb68d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+
+var C = class {
+ static async *method({ x: y = unresolvableReference }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(ReferenceError, function() {
+ method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..0185631195
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..451fb901d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..5b96ebcd4a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..86ede07948
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: undefined }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..e1f678840d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ static async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..2f6209bb65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var C = class {
+ static async *method({ w: { x, y, z } = undefined }) {
+
+ }
+};
+
+var method = C.method;
+
+assert.throws(TypeError, function() {
+ method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..f5171ab8ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: { x: undefined, z: 7 } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..f0f2b52f51
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async *method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ get v() { count++; return 2; } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..5d41ca53a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ static async *method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method(o).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..cd60288cf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async *method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({x: 1, y: 2, a: 5, b: 3}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..3061020be9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..db581d5bc8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..635e856952
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-name-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..fb7eb9c8fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..7b2fddf1a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[7, 8, 9]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..f80becc5bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..fba8fb0def
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..010385a5ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..f04f67b10e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[23]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..bc895cbbaf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..b7e65573a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([values]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..2621e6acd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..3d3042c685
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..0269356212
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a6a33e7d46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..2f757ab5b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..8058133277
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..3947fcb041
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([,]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..a275fa2ff0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async * #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([null, 0, false, '']).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..16f794307d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([undefined]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..9d984ee3df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..deaae7a20a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..ba9ed9b0cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..0a4aa44308
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..3e4e90aba5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..06b51fcde6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([{ x: 11, y: 22, z: 33 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..540b2cc628
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..9b47cbc1f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([{ u: 777, w: 888, y: 999 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..aab52423aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([,]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..a6fc24b76e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Elision advances iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..72d3a0e776
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..094201d82f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,95 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([3, 4, 5]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..9c851236cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element containing an elision (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..349cbf3128
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..4da085b9d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element containing a rest element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..2858578bed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Lone rest element (direct binding) (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..40ae5d9c4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element following elision elements (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..58ac2243dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..847e24b44f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Lone rest element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..389dcb5f15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..6ce6b0d7f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..1cbb64462c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..9e7337834d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..e0c772a31c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..c02c6cfdf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..d45a868e1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..e21c1789c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([7, 8, 9]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..e5fc9c4ed2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..0cac317176
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..bd30b11f40
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..79d7734db7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..404c09e15b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..e49a16305f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..fc3bbaf9e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..42456c97ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..fab2692619
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..4aa466daf7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..204f097e9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ async * #method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..5df820152e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..3ea482f2ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..adc1327f8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a91d8e31e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..0e45412491
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..d4d6cd1e08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..d9857311dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..dcaa73ed69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async * #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..4ce5515e9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..5b7146755d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..0dc356769a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..8401458ffa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..1a2546e758
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..cfe69edcca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..7d5538818f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..bc37bb72a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..43f3033c84
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..f2ca707af7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..7965e29881
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..e9ac4749a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..9f4eefe28c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,95 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..528253c273
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..96cea6da19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..5c3256c472
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..1b62ac1a42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..41d9098615
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..3785ded56f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..22492932d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..1afa852948
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..6d5fa623d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..55ba575608
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..c1c38907d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..0cb20acf53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..6a1f3f543c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..af67d4fca5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..0f2a4be3bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ async * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..490aec6215
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ async * #method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e33df53c47
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..846d241239
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..59e2b40db4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..a695121cd4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..73ce3fd82a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..347f0723c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..bfb651e342
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..7257a565d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..293408c041
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..c1f15f9ecd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..ddfdde3558
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..7ea8b830a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..052b40e875
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..b7267de53e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..7dd6fbbc52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..fff81d371b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..40c1b0b2c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ async * #method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..6bb6c41e91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ async * #method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..981f0a0c5c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (private class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..f5bca17597
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ async * #method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e896c004d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..26e74f99ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..15c3a78988
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..65b384a297
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..8c2b84fb74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..cad6e5e6ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: null, x: 0, y: false, z: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..a289b977eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..68b835f8ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..de0a8470fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: [45] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..ecfc5e72dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: [7, undefined, ] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..d3f5277466
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ s: null, u: 0, w: false, y: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..c28b92194b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..a7f5cdddcd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..075fc13b49
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..42f7eab5fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: undefined }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..7fe3a6bd9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: { x: undefined, z: 7 } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..686c688182
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ async * #method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ get v() { count++; return 2; } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..976469d7ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ async * #method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(o).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..3086888a40
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
+/*---
+description: Rest object contains just unextracted data (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ async * #method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({x: 1, y: 2, a: 5, b: 3}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..b581b2beb6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..707fb66e0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..118c810aa9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..36e9742b4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..d0de1b7573
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[7, 8, 9]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..642b5d1a17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..2907dbb274
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..bc5ebd1ccf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..4721ed0e12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[23]]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..428550a976
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..c7e9c81a20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([values]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..8ac93243b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..bad5a3c2bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..bcbb72465c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..f3351d4446
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..b8eeb4e547
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..c777bc5427
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..e49d4d30fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([,]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..2e8f7ce8bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([null, 0, false, '']).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..ab2532741b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([undefined]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..c69b9f65ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..67c94fe544
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..677db6424c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..f54467219b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..7f8ca75d45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..73c9a8d30b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([{ x: 11, y: 22, z: 33 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..379068a2d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..abaadb7d5c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([{ u: 777, w: 888, y: 999 }]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..0f719c151f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([,]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..dd345e7840
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Elision advances iterator (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..a3268950fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..b5eebf7e18
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,95 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([3, 4, 5]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..35dee96e2f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an elision (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(g()).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..d71fd54e29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..854d8480c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..ac677f6673
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..5b77915429
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element following elision elements (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..7dcc77414d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..ee662f2a1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Lone rest element (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..e028671b8a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..c0ea309568
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..1e0a48f8cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..a78e42eae8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..f9893c578e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..0e5ffef29b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..ba9c828dca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..05bffa5415
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([7, 8, 9]).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..119d707cb1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..5c77269f3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..f459332127
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..b56d272f13
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..4a3ba6d20c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..64bedb062e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..237dcb9622
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4328394728
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..5cd252e229
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..742313190a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..fdcbbb79d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..cac8f353f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e5fe2c1293
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..bc4e244b7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..f0c471ddcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..733ba6aef5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..28d53e835c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..00f0cf91cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..90983253ec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..0895f235ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..a48944b39f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..52d7204d5e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..78d9dee927
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..07542144f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..a47d400f1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..89c993a55e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..7d40d76dbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..706267f31a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..5d49135545
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..c998ca36f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..09b83a3280
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..6427395bf3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,95 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..60d3fefb4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..1047b1df9e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..5403e7b3cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..36be1ac29f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..ee15ae51ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..72cd5e8c8c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..39c2cfa259
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..d0bce64835
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..146b61b1e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..8b4b987d2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..40280123ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..ad69fe1d75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..c9493d922b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,70 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..7412ac21d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..16e1bf5811
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+
+var callCount = 0;
+var C = class {
+ static async * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..accd3781e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..7220e985c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..ee9cf79d41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..c721a7278c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..72c901902b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..c96d0a8e39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..7ac7db1765
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..987b5ec39b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..4a2094debe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..ea65882d11
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..aba6c1e013
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..6c2a80a3ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..515736e02b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..1e2abcfac6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..c3fb47b0b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..32e2e6f731
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..d73d4ac141
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..d108e79605
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..49003bbba5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..9a70ef9a30
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (private static class expression async generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..6be58fb317
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..74df3c5aea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,73 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..2eec8f1326
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..cd992f1869
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..b5db0f17f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..605510397f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..f4b9de2ed8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: null, x: 0, y: false, z: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..db159de3d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..75f6802985
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..0ec00fbbb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: [45] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..7c9f0e1c87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: [7, undefined, ] }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..f1a6e8f425
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ s: null, u: 0, w: false, y: '' }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..9ebb5ca781
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..bacd9b815a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..e88a25a335
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,70 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..f578f83348
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: undefined }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..26e1381ffe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: { x: undefined, z: 7 } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..38056a3c7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var count = 0;
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ get v() { count++; return 2; } }).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..5e2a3ca294
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(o).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..380951c4e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/async-private-gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-async-private-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (private static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+---*/
+
+
+var callCount = 0;
+var C = class {
+ static async * #method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({x: 1, y: 2, a: 5, b: 3}).next().then(() => {
+ assert.sameValue(callCount, 1, 'invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/browser.js b/js/src/tests/test262/language/expressions/class/dstr/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..3ae1893e4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ *method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..078f9c0592
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ *method([x, y, z]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([1, 2, 3]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..d3997ba7aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-get-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ *method([x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..e4d9f87b43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ *method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..fb2d41258d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-name-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..0d2743b021
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..c669f6a8a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[7, 8, 9]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..0a8747c2d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..9856354f39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..71a7efde90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ *method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..b2d89b2a3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ *method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[23]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..a69bf8978c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ *method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..900309f29e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ *method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([values]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..96e1d3df99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Nested array destructuring with a null value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ *method([[x]]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..1129dfc0c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..b3a7786a70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..d9e7d20f0b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..29f215824c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..c65faee96c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..c08f5848b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..2290d2beb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([,]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..f0e1d50f27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ *method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([null, 0, false, '']).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..330b1e6dcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ *method([x = (function() { throw new Test262Error(); })()]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method([undefined]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..59620170fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([undefined]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..70205a3b30
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ *method([ x = unresolvableReference ]) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..ee0dece257
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..ce3e6d8ccd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..da718226de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ *method([x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..c4a706272a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..b3b34710e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ *method([x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..276dcfad5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..120ff56b9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..042a0263df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([{ x: 11, y: 22, z: 33 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..2e611e41af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..1901e64df2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([{ u: 777, w: 888, y: 999 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..a22d819e87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Nested object destructuring with a null value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ *method([{ x }]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..e1e7b9ab8a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ *method([{ x }]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..ad55bed7f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Elision accepts exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ *method([,]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..e76f9b5a21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision-step-err.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ *method([,]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..e9db186978
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Elision advances iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..8c4ff9cb7d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ *method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..334f2b2240
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([3, 4, 5]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..f519344721
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,116 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element containing an elision (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..967452d768
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ *method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..b4eebb48ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element containing a rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ *method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..30e8963926
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Lone rest element (direct binding) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..fed0cff47f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ *method([, ...x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..b526bf4061
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ *method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..d6b8cde5f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..baefc5b619
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ *method([...x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..9dcfad7465
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ *method([...x]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..7dd7d1d9ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Lone rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ *method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..ff95a2dc33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..0855d3e645
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..111aafd8e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..72a8c16bf9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..42c8add97c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..f009912e9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..ad63d0b0f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..0fe68b9f99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([7, 8, 9]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..4c856d6a5c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ *method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..fdf308d087
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ *method([x, y, z] = [1, 2, 3]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..3e615aa847
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ *method([x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..3985bb39a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ *method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..fd68e90fb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..2da37ed041
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..fd37054adb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..9ca70f4275
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..7011987813
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4098e4e922
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ *method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..1d3b726423
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ *method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..50c29694e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ *method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..4116d11057
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ *method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..c87dd49e38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Nested array destructuring with a null value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ *method([[x]] = [null]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..f72b61335b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..b70481bb9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..93adb15007
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b431322b2d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..73b75b037e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..01d171c613
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..b1cfc734ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..f3e3c52403
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ *method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..f6be0fcd55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ *method([x = (function() { throw new Test262Error(); })()] = [undefined]) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..e0c128932a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..044c8fe9bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ *method([ x = unresolvableReference ] = []) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..89d1f02779
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..726b9ea651
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..ad4ded6526
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ *method([x] = g) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..f3d163d08b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..822633ff53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ *method([x] = g) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..1174d260a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..21bc263a09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..4d26eb1a16
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..15849cf74e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..2c12d40512
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..7b6e53122d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Nested object destructuring with a null value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ *method([{ x }] = [null]) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..26e00d6970
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ *method([{ x }] = []) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..8176bb01c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ *method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..f464006fe6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ *method([,] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..512d026f77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..2d91c889be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ *method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..ed6680799c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..60e7601e2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,116 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ *method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..0c58c3719c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ *method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..d680dff4d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ *method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..2f59ecf746
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..b0ad861ca5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ *method([, ...x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..9956442115
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ *method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..734be2d5d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..cac6c2ad78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ *method([...x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..31a3311546
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ *method([...x] = iter) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..0a8d82f84e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Lone rest element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ *method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..7cce2ff0d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..1f085b4a3e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..e084820189
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..5379be57e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..14b54ac1aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..19b0598530
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ *method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..32c8faf2eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ *method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..210b4c1971
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-null.js
new file mode 100644
index 0000000000..8b5eb96289
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-null.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ *method({} = null) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..876f9eb888
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-init-undefined.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ *method({} = undefined) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..b79e3999bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ *method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..51da330ccd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ *method({ poisoned } = poisonedProperty) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..b9230af5d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..461743240f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..7af28f07fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..2072d4bee3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..35aa6c0276
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..d76e75e96d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ *method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..857086f508
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ x = thrower() } = {}) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..e500325143
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ *method({ x = unresolvableReference } = {}) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..2faa4ae624
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..914a53b8b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ a, b = thrower(), c = ++initCount } = {}) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..77a9e464b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..6ebc4056d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..ad693e0c3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ *method({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..f5bd622271
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..a763c30790
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ [thrower()]: x } = {}) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..83f8a19685
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ *method({ poisoned: x = ++initEvalCount } = poisonedProperty) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..6b0f7bbeab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..1ab80bd072
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ x: y = thrower() } = {}) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..2f0f09be2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ *method({ x: y = unresolvableReference } = {}) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..226ba35103
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..ee4f37d7b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..28cd402c2d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..91ee6fb10a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..1f2d472193
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..efaa31a501
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ *method({ w: { x, y, z } = undefined } = { }) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..410fb49e62
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..0b08e4e726
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ *method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..ebbde42b42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ *method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..ef288fd328
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-null.js
new file mode 100644
index 0000000000..2f7c7330ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-null.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ *method({}) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-undefined.js
new file mode 100644
index 0000000000..c69f4deac4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-init-undefined.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ *method({}) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..c4ac22d30a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ *method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(obj).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..270192b693
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ *method({ poisoned }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..1d23f79598
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..7c860654c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b0e7ed2f42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..dc192e6f70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..6485ba3ca1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..c4458585ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ *method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: null, x: 0, y: false, z: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..d94517fefc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-throws.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ x = thrower() }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..0ccddb7e37
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ *method({ x = unresolvableReference }) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..e0e97b132d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..32b7fc9edb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-list-err.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ a, b = thrower(), c = ++initCount }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..1ec0609e2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..05b55728f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: [45] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..516eecba29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ *method({ w: [x, y, z] = [4, 5, 6] }) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..f76b30d4ec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: [7, undefined, ] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..8e374e9451
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ [thrower()]: x }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..e2a0ff1663
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ *method({ poisoned: x = ++initEvalCount }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(poisonedProperty);
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..39fa7d4ef1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ s: null, u: 0, w: false, y: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..9e5ec6fb89
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ *method({ x: y = thrower() }) {}
+};
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..d5fa950950
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ *method({ x: y = unresolvableReference }) {}
+};
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..bdd9e40623
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..944678198d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..45bc6d01fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Binding as specified via property name and identifier (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..df3ccd9d83
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: undefined }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..3ef02e57b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..50c8f10969
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ *method({ w: { x, y, z } = undefined }) {}
+};
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..ea46519fcc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: { x: undefined, z: 7 } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..780501b11c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ *method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ get v() { count++; return 2; } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..5fa420f6d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ *method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(o).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..ee410086d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth.template
+/*---
+description: Rest object contains just unextracted data (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ *method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({x: 1, y: 2, a: 5, b: 3}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..6b2c777b97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static *method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..f9d214e31e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ static *method([x, y, z]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([1, 2, 3]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..493868ba26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-get-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ static *method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..ce7fb1754c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static *method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..703cac80d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..2921f1311f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..51884c5710
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[7, 8, 9]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..7911a37ba8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..29050c869b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..f54aa894b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static *method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..ebe84e1e6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static *method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[23]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..12ec501f28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static *method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..54ed519a8f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static *method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([values]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..8a7037f020
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Nested array destructuring with a null value (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ static *method([[x]]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..215c7a86b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..5cffd3fab5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..c3044d4ae7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..7c75bd934b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..55ddffb16c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..e3d1840bd5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..848f834b65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+C.method([,]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..98c880728d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static *method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([null, 0, false, '']).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..04782f2edc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ static *method([x = (function() { throw new Test262Error(); })()]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method([undefined]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..6c5d66ddd9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([undefined]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..cae86bff7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static *method([ x = unresolvableReference ]) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..2a64371f6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..31037bbc66
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..72cf4825ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ static *method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..19027a8dce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..c2ea8eabb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static *method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..16bca2b99b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..bd5ebcc9f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..dc664dccd3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([{ x: 11, y: 22, z: 33 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..368309363a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..183eb1f942
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method([{ u: 777, w: 888, y: 999 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..4ad8f993f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Nested object destructuring with a null value (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static *method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..1ac2258266
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static *method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..6479c5f783
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static *method([,]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..ee97992dbf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision-step-err.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ static *method([,]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..48e2fb836f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Elision advances iterator (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..0e1b06484c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static *method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..6f5d443641
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([3, 4, 5]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..3a9d8a783e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,116 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element containing an elision (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..52616b2f2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static *method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..03ab658328
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static *method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..be7f756099
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..acf0beebfe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ static *method([, ...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..d0b24266c5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static *method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..b5efb3eec1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..6e963688e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ static *method([...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..d2c2819821
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static *method([...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..75a3fb9724
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Lone rest element (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static *method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..d4726c801f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..43537c852e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..127d1af819
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..53fd4a7a72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..c8af4e4a48
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..27d4cce982
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..3096f0ea81
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..5eb2c63874
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+C.method([7, 8, 9]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..20d6db84c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static *method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..9cdb176e3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ static *method([x, y, z] = [1, 2, 3]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..8a7ef761ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ static *method([x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..f929b119d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static *method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..efc67322ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..278af84637
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..9d1e8a1e7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..5f1eb33fdc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..01d3912f71
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..ff657e5ee4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static *method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..bfde4aceb9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static *method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..47d2020c73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static *method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..754b7e372f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static *method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..927bfed233
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Nested array destructuring with a null value (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ static *method([[x]] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..f1ce4f5683
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..21c9730b3f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..44932a298e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0a6536a82c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..355c85819b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..53cbc4f54c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..9c44262bfe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..537388e575
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static *method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..37d11995d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ static *method([x = (function() { throw new Test262Error(); })()] = [undefined]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..72d565e7c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..4e4a880f7a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static *method([ x = unresolvableReference ] = []) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..52b970d465
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..1c09b630ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..157abb25ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ static *method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..452cf400d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..29c9718072
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static *method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..1a46740221
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..38e406525b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..1bb79798f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..32269b1ad5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..8056aca11d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..2ef99972c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a null value (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static *method([{ x }] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..6a47f596b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static *method([{ x }] = []) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..8f7253624b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static *method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..656f28fc42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ static *method([,] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..5fd67f4560
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..23df175222
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static *method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..cf0d8c1f4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..7e4766f179
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,116 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static *method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..ebe4400ccd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static *method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..9634c82f73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static *method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..06188cde55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..f2152cfbc6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ static *method([, ...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..366523f2c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static *method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..a95ddf1450
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..c066660167
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ static *method([...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..4d9d4f4096
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static *method([...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..636f541eb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static *method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..0fcae1fc0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..1a52028b0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..1b18fb3601
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..64703a8fe4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..176048a28a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..b9b44d0b86
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static *method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..3e2c2964d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..eb6c6603fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static *method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-null.js
new file mode 100644
index 0000000000..df2c10adf0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static *method({} = null) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..f6201cec9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-init-undefined.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static *method({} = undefined) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..8c39f598a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static *method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..c596a190fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static *method({ poisoned } = poisonedProperty) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..1d4479bdaf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..0cd9829230
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..3c4937a7d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..96ea4a5b6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..95ca4e9e72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..3f3f9f9812
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static *method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..fe6207775e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ x = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..90b7420c65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static *method({ x = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..d065b7abc3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..2db654dbaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ a, b = thrower(), c = ++initCount } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..105e0ae5ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..2d1f02c0a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..01128fe2e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static *method({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..bcef5b8f73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..8d2768e3c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ [thrower()]: x } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..b6295926ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static *method({ poisoned: x = ++initEvalCount } = poisonedProperty) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..4177b19aa3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..744ac2ff89
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ x: y = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..2127a9df17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static *method({ x: y = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..019674754e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..892e54bc60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..cfa80698f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..e4e1d954eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..c3b86ba638
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..2f9f98bc4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static *method({ w: { x, y, z } = undefined } = { }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..4cf53087d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..705e755c95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static *method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..5144dffb31
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static *method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..d0d7dfdc10
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-null.js
new file mode 100644
index 0000000000..9f7c4e3a75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-null.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static *method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-undefined.js
new file mode 100644
index 0000000000..0392d3e6fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-init-undefined.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static *method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..d224216415
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static *method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(obj).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..bd1cfb0bd0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static *method({ poisoned }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..d772dce8e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..e8bd682f8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..3f71fb921d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..aba15e8f61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..889501689c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..c605f975d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static *method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: null, x: 0, y: false, z: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..4e25bf50ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-throws.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ x = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..48caf63e1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static *method({ x = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..5f8e757d8a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..8a1c2744aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-list-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ a, b = thrower(), c = ++initCount }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..dd37cb90b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..56c0839b41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: [45] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..be87a419b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static *method({ w: [x, y, z] = [4, 5, 6] }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..ec183f8622
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: [7, undefined, ] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..7e4aeb2b98
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ [thrower()]: x }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..9f1544be75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static *method({ poisoned: x = ++initEvalCount }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(poisonedProperty);
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..c6531a4eb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static *method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ s: null, u: 0, w: false, y: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..981bf4e900
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static *method({ x: y = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..33e7bfaa1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static *method({ x: y = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..54f3899a64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..3e339e641c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..c69e3d5e45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..826d0d0d2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: undefined }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..c38a37f0fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..457ede6fa5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static *method({ w: { x, y, z } = undefined }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..5686abd417
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: { x: undefined, z: 7 } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..f6c3220e18
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static *method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ get v() { count++; return 2; } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..74f350c496
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static *method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method(o).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..91d4b46fdc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({x: 1, y: 2, a: 5, b: 3}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..7cbbc12184
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..806bd09118
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ method([x, y, z]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([1, 2, 3]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..4469ed652a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-get-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ method([x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..ea4c0777a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-init-iter-no-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..be583dfe69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-name-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..5adf7e02b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..e8a2e6b687
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[7, 8, 9]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..bed37f0e59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..c7f1d4b7ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4fd3e1b43f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..66d52653d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([[23]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..65827a1784
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..d350240ca4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([values]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..d5aca5ea02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Nested array destructuring with a null value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ method([[x]]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..e2a4e64782
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..eca8ba11f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..f4a1d30f3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..1d30ab4956
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..d7abc9ab1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..66ecf1c2ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..3c9f29554f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([,]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..0f9ae4b548
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([null, 0, false, '']);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..7158dacddd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ method([x = (function() { throw new Test262Error(); })()]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method([undefined]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..21c9116503
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([undefined]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..a8e747e6c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ method([ x = unresolvableReference ]) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..fde09d9fe8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..cc2a754940
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..d571093957
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ method([x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..39c1c0c51f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..6f8c616fb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ method([x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..70f940e3d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..46bcb6a3f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..ec57cec4f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([{ x: 11, y: 22, z: 33 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..17eb364222
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..f1da48de15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([{ u: 777, w: 888, y: 999 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..ef223bc090
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Nested object destructuring with a null value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ method([{ x }]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..17548d17e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ method([{ x }]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..67705e38bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Elision accepts exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ method([,]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..090f65f71d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision-step-err.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ method([,]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..109d2d91c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-elision.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Elision advances iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..10e50538d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..9502e2dd4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([3, 4, 5]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..0b4300caff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element containing an elision (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..b6c6ef1dfc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..c6ebbbc68e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element containing a rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..9bb0b7f15e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Lone rest element (direct binding) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..847ef07625
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ method([, ...x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..e2fe4d665a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element following elision elements (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..379b0f8c1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..8f4f5555af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ method([...x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..ad019eafd8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ method([...x]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..53e9b1da82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Lone rest element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..ef1899ce96
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..aec4c12d90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..39bfe34869
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..ebaf00baff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..dc07d2c004
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..9a7edd0b79
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..07606b887b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..a353b76ffd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest element containing an object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+new C().method([7, 8, 9]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..c2954ef1d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..3d7b26c119
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ method([x, y, z] = [1, 2, 3]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..20d7f79684
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ method([x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..b4c679ad24
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..c9cda5261c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..1feac4a4f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..82383fb096
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..0fd71ef875
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..752e1ed050
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..ed5ef758e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..cfbcb462f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..1214245baa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..a15dcbe2b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..318811d7f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Nested array destructuring with a null value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ method([[x]] = [null]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..0332b7a941
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..af2f6ad15a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..70fc6312a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b1d93ca322
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..3a52ab17c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..42edbe8b98
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..4cc20a1bae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..0cec1bec0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..315366340f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ method([x = (function() { throw new Test262Error(); })()] = [undefined]) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..32bf9cd915
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..42484e4e4e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ method([ x = unresolvableReference ] = []) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..80433e508f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..4d4ad14ff9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..82d13892ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ method([x] = g) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..8f88f821f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..015a95ed3c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ method([x] = g) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..91b4648199
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..cc53a273c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..5a8a8d1d01
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..8c23151586
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..af2546e70a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..bb3e822277
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Nested object destructuring with a null value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ method([{ x }] = [null]) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..1f03352ba6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ method([{ x }] = []) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..b56c437c01
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..195db81937
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ method([,] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..8b2768eaf9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Elision advances iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..13e387e72a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..5fdc039247
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..f85df5738e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element containing an elision (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..c54b330b90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..a836aaa1af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element containing a rest element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..92e6dc8980
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..bce6f02484
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ method([, ...x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..d318f73a4f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element following elision elements (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..7348d391e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..6fbff7c47e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ method([...x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..2694f793be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ method([...x] = iter) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..b4e822ee73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Lone rest element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..ea77c46b1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..4261d14d95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..26442c4544
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..ab62668157
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..bf62e198a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..c74ebb9760
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..3817e8c597
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..8b909c3008
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-null.js
new file mode 100644
index 0000000000..cc6e923f6e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-null.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ method({} = null) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..fa126dd3be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-init-undefined.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ method({} = undefined) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..0fb026a789
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..1be134bdf2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ method({ poisoned } = poisonedProperty) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..77e6692ef8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..a25646e4be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..693e502661
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..00257aceec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..6d53a8e0ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..3762c38335
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..188209bc0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ x = thrower() } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..43b2bfebe9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ method({ x = unresolvableReference } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..69f3cdf584
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..b59a15301b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ a, b = thrower(), c = ++initCount } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..fe9a0c0a6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..b813252117
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..014284d310
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ method({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..7e08ac13d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..a46e8bd5b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ [thrower()]: x } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..c0bd16067d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ method({ poisoned: x = ++initEvalCount } = poisonedProperty) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..5b2a898498
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..ba8ccb2e69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ x: y = thrower() } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..f36922ba20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ method({ x: y = unresolvableReference } = {}) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..303dca0361
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..da0e174cb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..e998f4c925
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..167e94c6f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..1d36b8aca9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..e00e19e9ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ method({ w: { x, y, z } = undefined } = { }) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..debd713bcd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..b5a6feb21c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..716497aaa6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..d4dff96549
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-null.js
new file mode 100644
index 0000000000..bbfcb54076
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-null.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ method({}) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-undefined.js
new file mode 100644
index 0000000000..7c8f50ff27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-init-undefined.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ method({}) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..50875621e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(obj);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..f9ecd652d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ method({ poisoned }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..628bc77583
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..0d6a9809de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b86b666e26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..45bd37c0de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..cb369546ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..0ce15730b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: null, x: 0, y: false, z: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..4f73901e1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-throws.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ x = thrower() }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..565f440509
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ method({ x = unresolvableReference }) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..d134a0042e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..59321071b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-list-err.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ a, b = thrower(), c = ++initCount }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..9b1cd7221a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..f29d052070
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: [45] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..cf734185d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ method({ w: [x, y, z] = [4, 5, 6] }) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..4492e9dcaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: [7, undefined, ] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..f80d85101a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Evaluation of property name returns an abrupt completion (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ [thrower()]: x }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..9d2b50ef1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ method({ poisoned: x = ++initEvalCount }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method(poisonedProperty);
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..3783ffcdd0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ s: null, u: 0, w: false, y: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..75a924b54d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Error thrown when evaluating the initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ method({ x: y = thrower() }) {}
+};
+
+var c = new C();
+
+assert.throws(Test262Error, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..0938f7f2bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Destructuring initializer is an unresolvable reference (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ method({ x: y = unresolvableReference }) {}
+};
+
+var c = new C();
+
+assert.throws(ReferenceError, function() {
+ c.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..18dc6112ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..2884ca894c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..30b70582c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-id.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Binding as specified via property name and identifier (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..058bf0934b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: undefined });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..a16f55edbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..af88355b44
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ method({ w: { x, y, z } = undefined }) {}
+};
+
+var c = new C();
+
+assert.throws(TypeError, function() {
+ c.method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..860508d6d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ w: { x: undefined, z: 7 } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..c181921b84
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({ get v() { count++; return 2; } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..d8844b82a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method(o);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..fb794db03f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-meth.template
+/*---
+description: Rest object contains just unextracted data (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+new C().method({x: 1, y: 2, a: 5, b: 3});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..90db339fa9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..fe28076658
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ static method([x, y, z]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([1, 2, 3]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..9ab77d237e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-get-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ static method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..4d282326c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..6fec6e7295
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-name-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..aea2f8ab10
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..ebf06117f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[7, 8, 9]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..85ec2a446f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..c471272f07
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..242e225f1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..0958e05bbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([[23]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..b9414e552f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..1817ee2886
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([values]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..c112b28535
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Nested array destructuring with a null value (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ static method([[x]]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..2a5c2d259c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..0048d37326
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..6cb201b898
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..462f1ee799
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..789a38b27c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..c5f682dd1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..61cc595f8b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+C.method([,]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..7601435ba4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([null, 0, false, '']);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..67148341ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ static method([x = (function() { throw new Test262Error(); })()]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method([undefined]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..9d35477330
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([undefined]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..af1d8b448e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static method([ x = unresolvableReference ]) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..4594f6ebcd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..7f461c495b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..761fb63d4e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ static method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..80b5051074
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..b14c73d458
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static method([x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(g);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..6762ee3660
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..41742666a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..22aa6cf81a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([{ x: 11, y: 22, z: 33 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..3048a25f29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..cfed9c8b32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method([{ u: 777, w: 888, y: 999 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..f65a6375b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Nested object destructuring with a null value (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([null]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..f18bad3782
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static method([{ x }]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method([]);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..a7e05d3c3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static method([,]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..678b9bec26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision-step-err.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ static method([,]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..af4bb5a6a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-elision.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Elision advances iterator (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..15befd5b7d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..30e9de0775
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([3, 4, 5]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..28bb6092a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element containing an elision (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..76f0114ffb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..15640bd127
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element containing a rest element (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..13a7f6b173
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Lone rest element (direct binding) (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..4206a5d5f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ static method([, ...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..fe04dbaa28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element following elision elements (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..98b47c7b34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..a07d6f4686
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ static method([...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..c736d61adb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static method([...x]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(iter);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..0c545cd109
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Lone rest element (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..15d5c2ded2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..5aebad1f34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..c36f0ba2bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..35160e397f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..d2913fa4fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..fa25aa336f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..1103d98801
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..0821c065ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+C.method([7, 8, 9]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..66f566763a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js
new file mode 100644
index 0000000000..69566c3a3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err-array-prototype.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err-array-prototype.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iteratorRecord be ? GetIterator(value).
+
+ GetIterator ( obj [ , hint [ , method ] ] )
+
+ [...]
+ 4. Let iterator be ? Call(method, obj).
+
+ Call ( F, V [ , argumentsList ] )
+
+ [...]
+ 2. If IsCallable(F) is false, throw a TypeError exception.
+
+---*/
+delete Array.prototype[Symbol.iterator];
+
+var C = class {
+ static method([x, y, z] = [1, 2, 3]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err.js
new file mode 100644
index 0000000000..e8f9a19218
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-get-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-get-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Abrupt completion returned by GetIterator (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+
+---*/
+var iter = {};
+iter[Symbol.iterator] = function() {
+ throw new Test262Error();
+};
+
+var C = class {
+ static method([x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..b516a6ddc6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..ba3e03e4a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..eefb1dd20e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..c40a26aa74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..cce74e1d51
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..8ffa14e271
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..45b3e8707a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..3665a06576
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..ca7bde5b78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..9a2491d9ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js
new file mode 100644
index 0000000000..a8f29c979a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-ary-val-null.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Nested array destructuring with a null value (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ 1. Let iterator be GetIterator(value).
+ 2. ReturnIfAbrupt(iterator).
+---*/
+
+var C = class {
+ static method([[x]] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..f5fd19484a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..297f72b0e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..ef99927b92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..babdef4260
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..eb4e532244
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..ec3fdfb0f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..07b559dcb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..20995bbfa3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 0000000000..7b7db40b72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+var C = class {
+ static method([x = (function() { throw new Test262Error(); })()] = [undefined]) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..95af8436cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
new file mode 100644
index 0000000000..293b83d8e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-init-unresolvable.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static method([ x = unresolvableReference ] = []) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..964ed5b89f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..4720ace484
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
new file mode 100644
index 0000000000..d4409b7bed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-step-err.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ throw new Test262Error();
+ }
+ };
+};
+
+var C = class {
+ static method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..20a52118d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
new file mode 100644
index 0000000000..976fcd30a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val-err.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(v).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var g = {};
+g[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static method([x] = g) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..391bbe5a85
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..29778d7160
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..409d5b7a16
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..19d843f443
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..1728fdf58b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js
new file mode 100644
index 0000000000..558ce4f712
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-null.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a null value (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static method([{ x }] = [null]) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
new file mode 100644
index 0000000000..b6ef08f149
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elem-obj-val-undef.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Nested object destructuring with a value of `undefined` (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ e. Else
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ObjectBindingPattern
+
+ 1. Let valid be RequireObjectCoercible(value).
+ 2. ReturnIfAbrupt(valid).
+---*/
+
+var C = class {
+ static method([{ x }] = []) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..49ad9d165e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js
new file mode 100644
index 0000000000..5b07f94ee2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision-step-err.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Elision advances iterator and forwards abrupt completions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+
+---*/
+var following = 0;
+var iter =function* () {
+ throw new Test262Error();
+ following += 1;
+}();
+
+var C = class {
+ static method([,] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+iter.next();
+assert.sameValue(following, 0, 'Iterator was properly closed.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..4322c07095
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Elision advances iterator (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..723409fbff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..0f478ee496
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..f0d18c5631
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..25e5874eac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..8c348fb87b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..72493a44ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
new file mode 100644
index 0000000000..b7e2edc32b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision-next-err.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+
+---*/
+var iter = (function*() { throw new Test262Error(); })();
+
+var C = class {
+ static method([, ...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..6852238383
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..92a704b6c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
new file mode 100644
index 0000000000..e860f70442
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-step-err.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorStep returns an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ a. If iteratorRecord.[[done]] is false,
+ i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ iii. ReturnIfAbrupt(next).
+
+---*/
+var first = 0;
+var second = 0;
+var iter = function*() {
+ first += 1;
+ throw new Test262Error();
+ second += 1;
+}();
+
+var C = class {
+ static method([...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+iter.next();
+assert.sameValue(first, 1);
+assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
new file mode 100644
index 0000000000..9b5abd19ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id-iter-val-err.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error forwarding when IteratorValue returns an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ c. Let nextValue be IteratorValue(next).
+ d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
+ true.
+ e. ReturnIfAbrupt(nextValue).
+
+---*/
+var poisonedValue = Object.defineProperty({}, 'value', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return poisonedValue;
+ }
+ };
+};
+
+var C = class {
+ static method([...x] = iter) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..d8c3700ec5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Lone rest element (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..a0edbdf1cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..ae6ed2dae3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..c68602977c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..006ec87b74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..ab9c498ad5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..1e757120d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,81 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..37333b0506
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..4fd6fc9574
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-null.js
new file mode 100644
index 0000000000..a39b9f53e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static method({} = null) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-undefined.js
new file mode 100644
index 0000000000..0e7476ea00
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-init-undefined.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static method({} = undefined) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..28ac91d9e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..f26f38c550
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static method({ poisoned } = poisonedProperty) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..06f5fa5304
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..28a3e055f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..0ca67e9639
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..53fb1bbbb1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..d66ce2709f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..8410e567b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..1c90222902
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-throws.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ x = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..0a409a0261
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static method({ x = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..4608f5af7d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..5c7a9a9a77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-list-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ a, b = thrower(), c = ++initCount } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..2e5ea686e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..1fb66755d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..7e988bbdbb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static method({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..4e22e390f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..3d1ef8649c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ [thrower()]: x } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..c7a6ddfe82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static method({ poisoned: x = ++initEvalCount } = poisonedProperty) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..2fb709c945
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..5b6205c7ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ x: y = thrower() } = {}) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..23e12913ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static method({ x: y = unresolvableReference } = {}) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..4873c46ac1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..48b9706012
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..571b185ff5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..b1777991be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..ba82b73aff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..330ea82c63
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static method({ w: { x, y, z } = undefined } = { }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..52a3604099
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..2a42a77b81
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..e86f620da2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..66f25121a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-null.js
new file mode 100644
index 0000000000..280a47e941
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-null.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-null.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (null) (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(null);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-undefined.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-undefined.js
new file mode 100644
index 0000000000..df0a95d5e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-init-undefined.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-init-undefined.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Value specifed for object binding pattern must be object coercible (undefined) (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+
+var C = class {
+ static method({}) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method(undefined);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..a99092895c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-empty.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(obj);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-get-value-err.js
new file mode 100644
index 0000000000..b462384287
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-get-value-err.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. Let v be GetV(value, propertyName).
+ 5. ReturnIfAbrupt(v).
+---*/
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static method({ poisoned }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(poisonedProperty);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..ab2f914f6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..a35383b6f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..5ec061d8a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..0dbff560e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..647b0e1f5c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..4877e96183
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: null, x: 0, y: false, z: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-throws.js
new file mode 100644
index 0000000000..ced097f054
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-throws.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ x = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js
new file mode 100644
index 0000000000..2ded573d1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-init-unresolvable.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static method({ x = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..875c995682
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-list-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-list-err.js
new file mode 100644
index 0000000000..a9861c983e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-list-err.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-list-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Binding property list evaluation is interrupted by an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPropertyList : BindingPropertyList , BindingProperty
+
+ 1. Let status be the result of performing BindingInitialization for
+ BindingPropertyList using value and environment as arguments.
+ 2. ReturnIfAbrupt(status).
+---*/
+var initCount = 0;
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ a, b = thrower(), c = ++initCount }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+assert.sameValue(initCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..867f874020
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..327600fa8c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: [45] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js
new file mode 100644
index 0000000000..5473d6c30c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary-value-null.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern taking the `null` value (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static method({ w: [x, y, z] = [4, 5, 6] }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..9806570b78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: [7, undefined, ] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-eval-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-eval-err.js
new file mode 100644
index 0000000000..96cc198981
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-eval-err.js
@@ -0,0 +1,79 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-eval-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Evaluation of property name returns an abrupt completion (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingProperty : PropertyName : BindingElement
+
+ 1. Let P be the result of evaluating PropertyName
+ 2. ReturnIfAbrupt(P).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ [thrower()]: x }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js
new file mode 100644
index 0000000000..ceb29677e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-get-value-err.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error thrown when accessing the corresponding property of the value object (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ 1. Let v be GetV(value, propertyName).
+ 2. ReturnIfAbrupt(v).
+---*/
+var initEvalCount = 0;
+var poisonedProperty = Object.defineProperty({}, 'poisoned', {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+
+var C = class {
+ static method({ poisoned: x = ++initEvalCount }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method(poisonedProperty);
+});
+
+assert.sameValue(initEvalCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..7ca1e1a230
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ s: null, u: 0, w: false, y: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js
new file mode 100644
index 0000000000..730a8c3832
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-throws.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Error thrown when evaluating the initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+function thrower() {
+ throw new Test262Error();
+}
+
+var C = class {
+ static method({ x: y = thrower() }) {}
+};
+
+assert.throws(Test262Error, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js
new file mode 100644
index 0000000000..b9e4b13852
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init-unresolvable.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Destructuring initializer is an unresolvable reference (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+
+ 6.2.3.1 GetValue (V)
+
+ 1. ReturnIfAbrupt(V).
+ 2. If Type(V) is not Reference, return V.
+ 3. Let base be GetBase(V).
+ 4. If IsUnresolvableReference(V), throw a ReferenceError exception.
+---*/
+
+var C = class {
+ static method({ x: y = unresolvableReference }) {}
+};
+
+assert.throws(ReferenceError, function() {
+ C.method({});
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..adb303cecf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..2e95f888d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..ab98882aac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..f4859760cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: undefined });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js
new file mode 100644
index 0000000000..0c99ea6b4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-null.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ w: null });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js
new file mode 100644
index 0000000000..5dbe3ee511
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj-value-undef.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
+// - src/dstr-binding/error/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern taking the `null` value (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var C = class {
+ static method({ w: { x, y, z } = undefined }) {}
+};
+
+assert.throws(TypeError, function() {
+ C.method({ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..d2cb8c0119
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ w: { x: undefined, z: 7 } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..f9b8e9846f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({ get v() { count++; return 2; } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..16a87d7b9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method(o);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..d865ae9a74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-meth-static.template
+/*---
+description: Rest object contains just unextracted data (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+};
+
+C.method({x: 1, y: 2, a: 5, b: 3});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..8a9cdcc257
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ * #method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..e44a228e1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-init-iter-no-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ * #method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..ba588daf7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-name-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..9b830f576b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..aa00522695
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[7, 8, 9]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..e630fffdfd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..332c123658
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..dd8b377d7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ * #method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..466f476178
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ * #method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[23]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..348209858f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ * #method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..bd410f3cec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ * #method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([values]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..029e06bd1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..868b06b05a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..4ac37a1d1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..d1354656f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..dae4950653
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..a793da1821
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..dd388d2aaf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([,]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..ca75a69d53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ * #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([null, 0, false, '']).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..21652460e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([undefined]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..b53e58e7c5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..39058ff5bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..4bc1cca4bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..d40d67f51b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..cbcf13893c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..217ad687fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([{ x: 11, y: 22, z: 33 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..88cd8d9531
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..e988121871
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([{ u: 777, w: 888, y: 999 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..f1bc5271b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ * #method([,]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..da179f78d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-elision.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Elision advances iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..a770fb4e98
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-empty.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ * #method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..fc27e6b9f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([3, 4, 5]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..5bd5af430d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,120 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element containing an elision (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..ec72211ef2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ * #method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..77093b6289
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element containing a rest element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ * #method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..59feaa0e88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Lone rest element (direct binding) (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..5aa5f57c72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element following elision elements (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ * #method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..d646cc68d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..df14ad02ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Lone rest element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..cf4079a9a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..dd5b599f06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..77f8bcc049
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..739d5c5c35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..0be42478e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..bd492bad5d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..b5fa1729a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..831d9a19ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([7, 8, 9]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..ad74fb6809
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..4b60f4ee06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..d4f2043577
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..752231a08e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..0447fa9dcc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..9924edbaa2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..62dd2e44e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..8caca6aab1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ * #method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..e32d807868
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ * #method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..8f073e8d88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ * #method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..8d4261bb47
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ * #method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..42cc963f00
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..e32c94f11e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..53f642c7fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..27c8a0105a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..949cf2107f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..910ef46738
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..062026c5d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..1dedf83a19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ * #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..5525e96014
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..3726148920
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..34bc7514b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..01791bc2e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..2eeb81976c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..12b907a50c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..0ead3ce831
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..cf65af89ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..d4de178a42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..4e21c102f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ * #method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..0e08833f55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Elision advances iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..09c34867f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ * #method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..7b8de7dd42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..0f445b5b4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,120 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an elision (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ * #method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..0e21e9f755
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ * #method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..fe2e109b6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element containing a rest element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ * #method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..237378db27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..5cc4bb75bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element following elision elements (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ * #method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..f83ad16b88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..a2ca45aeb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Lone rest element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ * #method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..288aada136
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..78ad656ed8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..affa305096
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..091e69397e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..b85d8ae365
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..35cba8ea4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ * #method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..954f131235
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..f161168a2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..5d5c4762e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ * #method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..93b312c9b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..3ab4ba5de7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..cb8b242e57
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..fb52d02224
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..bc427fcf43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..3c5d4cd4ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ * #method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..1c85e238c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..a0b7294587
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..11ab67aaff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..3c9ff05680
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..4b972be794
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..0b35228ced
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..57aa3fafcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..ee66ff8aa5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..273b2892d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..9ad4d18006
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..1c50996fab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ * #method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..eebe0d9fe4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ * #method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..562512127e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..ceef4fe8fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-empty.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ * #method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(obj).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..1dbe03daf5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..4947c6e3ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..df1974d57d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..83130c8d66
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..b2e3e9e1a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..1c7ac4234d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ * #method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: null, x: 0, y: false, z: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..4e00828637
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..c6ea74454b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..7667bdcb32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: [45] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..c348874bb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: [7, undefined, ] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..088a46f99a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ s: null, u: 0, w: false, y: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..7f971870b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..0535e66753
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..6455270c69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..b8df5d6ac7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: undefined }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..bcd6c1d83e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: { x: undefined, z: 7 } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..b706b22af9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ * #method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ get v() { count++; return 2; } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..cc65fc7161
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ * #method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(o).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..ca956ccad9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth.template
+/*---
+description: Rest object contains just unextracted data (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ * #method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({x: 1, y: 2, a: 5, b: 3}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..a0d3e0e850
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..656e7a62c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..2064d6e08c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-name-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..a9cf0d710e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..ce44408fb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[7, 8, 9]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..e15381fe64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..f55754f92e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..dee5b68812
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static * #method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..5d58a0f969
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static * #method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[23]]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..4b9fa06037
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static * #method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..10f9fe109d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static * #method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([values]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..3257f92388
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..dc442abba8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..a00dcd9dae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..b93ccab022
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..8213aa8300
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..ffe03ea3f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..bac4e2178b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([,]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..44a75f38b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static * #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([null, 0, false, '']).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..4f87cba717
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([undefined]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..0c42e2b598
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..340980b3b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..ec6a9d7801
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..2a42c6638a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..e65a4146e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..01fd488402
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([{ x: 11, y: 22, z: 33 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..71b5aba5bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..6e12625951
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([{ u: 777, w: 888, y: 999 }]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..717b44fb08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static * #method([,]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..27644db8bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Elision advances iterator (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..3df10176f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static * #method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..8d9a7bff41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([3, 4, 5]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..d5af7f7a41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,120 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element containing an elision (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(g()).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..7d629b26b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static * #method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..b44f144f5b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element containing a rest element (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static * #method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..fa12c89e27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Lone rest element (direct binding) (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..b042ea6651
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element following elision elements (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static * #method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..580f92a3e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..8938f56dcd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Lone rest element (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static * #method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..7b9b0fe8f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..71e640e52f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..02c428c832
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..fc461619c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..6a3ac8c58d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..97fbf38ce1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..4a688f0162
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..1981bb927d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([7, 8, 9]).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..0230cf435e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..5dd6efaa03
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,102 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..f2b1aaf5e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..feb6b1648d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..0993c7c8c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..f10eee4cc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..d8b3326854
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..bef2aff71e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static * #method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..a94393732b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static * #method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..8af24fdb12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static * #method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..d2b0a3fec0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static * #method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..f6441caff2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..21cc583d0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..74ee7f3724
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..2a632e4335
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..1624baff75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..5cd4e91f6b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..b509a49adb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..bf9017e493
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static * #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..f3579a52da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..2849a408c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..28006e1584
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..e0152b13cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..2e4c5da01c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,101 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..36c38da6d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..1c8fbdbe2f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..e8d64e7333
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..1b6ce40fdb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..46729de0c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static * #method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..3d03783340
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Elision advances iterator (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..a165105b49
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static * #method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..22143c6565
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..86de825eb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,120 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static * #method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..d771777d43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static * #method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..7e403c2090
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static * #method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..a3ee185694
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..ded7df6ae8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static * #method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..b6237320e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..4168b02d0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Lone rest element (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static * #method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..4e1b11860e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..52629097c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..1255644a5c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..be33f5692e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..57f0571459
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..fb230131a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..ecec85262e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..d15f1b2b2f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..a2c53e92d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static * #method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..cfed69ca39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..c01146e6ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..62f20b1d6b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..b73a84cf71
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..25c8294791
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..c05256f79e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static * #method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..be043c218e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..0c9c604c73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..3352c839d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..06e058a5ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..9696981403
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..9c810b9d85
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..8def1410eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..c33f787595
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..2c4629ce11
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..33286a9a32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..308dccc6ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static * #method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..16db9a4d02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static * #method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..3492b26dca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (private static class expression generator method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..144417f52c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static * #method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(obj).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..d11b70c346
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..9dfb132599
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..55e0da1362
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..9a6836a319
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..76601188cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..34d37c9627
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static * #method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: null, x: 0, y: false, z: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..bfb1a1be07
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..6c8551422f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..ca0ff775e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: [45] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..fc4a087c55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: [7, undefined, ] }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..58d2aab558
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static * #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ s: null, u: 0, w: false, y: '' }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..c222540f86
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..17106a1ce8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..ff41854899
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..ff294c17e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: undefined }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..3cac196ccc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: { x: undefined, z: 7 } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..9590acba6d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static * #method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ get v() { count++; return 2; } }).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..eca2c8ad64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static * #method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(o).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..fdf5348131
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-gen-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-gen-meth-static.template
+/*---
+description: Rest object contains just unextracted data (private static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, generators, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static * #method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({x: 1, y: 2, a: 5, b: 3}).next();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-close.js
new file mode 100644
index 0000000000..f9ab6ccbb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ #method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..3527294fb7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-init-iter-no-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ #method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-name-iter-val.js
new file mode 100644
index 0000000000..0c1c384b35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-name-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..51930c23cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..8de8d2fe46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[7, 8, 9]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..da53a1ac61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..5a8d5994ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..2029f5e516
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ #method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..37730571fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ #method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([[23]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..ccf3aa9649
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ #method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..a6e55f68b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ #method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([values]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..143d7a9c9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..3249641b99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..f72d84ac64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..86240bb8fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..90a557cf2b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..9f2e8cae4f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..9842981578
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([,]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..c16f5dfd5b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([null, 0, false, '']);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..81b67c5123
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([undefined]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..2cc95c97c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..a76f137d8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..d7b11bc87a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..3c3e6ae18a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..54cac0564d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..5ee30d2dc4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([{ x: 11, y: 22, z: 33 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..87ebcb47ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..952f07d5a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([{ u: 777, w: 888, y: 999 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..947ff6e066
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ #method([,]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision.js
new file mode 100644
index 0000000000..f5f65d5954
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-elision.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Elision advances iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-empty.js
new file mode 100644
index 0000000000..31ee044d0d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ #method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..5e71186e32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([3, 4, 5]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..3141b93dd8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,117 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element containing an elision (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..f2c2022151
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ #method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..797373f431
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element containing a rest element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ #method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..d57f44b40b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Lone rest element (direct binding) (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..7c166f8d89
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element following elision elements (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ #method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..7aafb5ae22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..c9b3600b1a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Lone rest element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ #method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..05ff8c6499
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..df14b116af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..d3ba92201d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..8e215a8402
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..236642cd38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..69725bc858
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..2a8d32a111
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..cb476a3572
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method([7, 8, 9]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..33e03e7809
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ #method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..472fbb5774
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ #method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..b788a317b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-name-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..bb099ba497
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..a0a5083448
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..e8eec4f32c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..86b9130128
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..0da9b0a1d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ #method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..31640e7373
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ #method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..28e5d3936e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ #method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..96f3864f59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ #method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..c5fb448403
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..7d0640a937
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..8594125a2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..23482225a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..d346d46897
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..90d5594576
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..283cad6a14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..482706e82f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..dff54aa06f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..f74d74611e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..d5aaa0e106
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..27e966854f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..6bb8e37a0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..eebda9b445
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..88116d8a5f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..a40c96c70f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..fb41ba8c26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..e1173268ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ #method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..997c6f88e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-elision.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Elision advances iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..4edf700213
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ #method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..755a844f12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..cb68f35aa2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,117 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element containing an elision (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ #method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..2439c38e7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ #method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..b2904924f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element containing a rest element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ #method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..a4c47ee290
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Lone rest element (direct binding) (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..66e6b6754d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element following elision elements (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ #method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..1578f4acc3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..f939e7d031
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Lone rest element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ #method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..ec0977b08e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..b54c921e12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..de951a390d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..38ce3e6fc2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..40ad67105c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..e34d3aa12a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ #method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..9e86a204a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ #method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..e64a645f06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..7bbf260a6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ #method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..bad2091018
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..fd685269ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..49d64ad7a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..bd007282af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..928e563b2f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..29d31918fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ #method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..525e34f1f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..01b66d2f3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..d649cf63dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..d1450a4bce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..e12d1dd153
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..a8aac75a6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..2a93f8f802
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..998caf267d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..d6aaf003e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..c1daf25450
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..7878793ff8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ #method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..b8b3d4f918
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ #method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..e849cfbe77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-dflt.template
+/*---
+description: Rest object contains just unextracted data (private class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-empty.js
new file mode 100644
index 0000000000..dd1309945a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ #method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(obj);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..91647c2988
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..f361f6bd86
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a4ae986a92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..528ec12ff2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..938a3df1c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..a3adcf38d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ #method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: null, x: 0, y: false, z: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..07293559c5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..212ca00fe2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..64cf56545b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: [45] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..a4efc89585
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-ary.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: [7, undefined, ] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..38e65038dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ s: null, u: 0, w: false, y: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..0740e2389c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..82c8f38a69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..8fc660ce4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Binding as specified via property name and identifier (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..0374327ea1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: undefined });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..49829fc3fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-prop-obj.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ w: { x: undefined, z: 7 } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..26a3634ade
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-getter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ #method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({ get v() { count++; return 2; } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..f5bf7a911a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ #method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method(o);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..61a9c40b59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth.template
+/*---
+description: Rest object contains just unextracted data (private class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ #method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ get method() {
+ return this.#method;
+ }
+};
+
+new C().method({x: 1, y: 2, a: 5, b: 3});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-close.js
new file mode 100644
index 0000000000..af2ec50c1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static #method([x]) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..7bd6460c17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-init-iter-no-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static #method([x]) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-name-iter-val.js
new file mode 100644
index 0000000000..2cb04d0bcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-name-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..2a6064b555
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..e54ea0ae26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([[x, y, z] = [4, 5, 6]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[7, 8, 9]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..6971437e5e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([[,] = g()]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..e928ff09f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([[,] = g()]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..a9374a1dcf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static #method([[] = function() { initCount += 1; return iter; }()]) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..cdd292381e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static #method([[] = function() { initCount += 1; }()]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([[23]]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..9e169b32ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static #method([[...x] = values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..e3323b8c72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static #method([[...x] = function() { initCount += 1; }()]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([values]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..3f6265c8ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..46a6c07141
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([arrow = () => {}]) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..b65cb5686e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..a944efa4c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([cover = (function () {}), xCover = (0, function() {})]) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..77976184ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([fn = function () {}, xFn = function x() {}]) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..f88393fefe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([gen = function* () {}, xGen = function* x() {}]) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..1aa3b4869f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x = 23]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([,]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..bb9472c5ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([null, 0, false, '']);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..8f47457b90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x = 23]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([undefined]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..fdeec85281
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..2f3bd4acf5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([_, x]) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..99601fa05e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..145838d743
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x, y, z]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..3e722621cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..3d805dab25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([{ x: 11, y: 22, z: 33 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..f4080f6d0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..52b7116ca6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([{ u: 777, w: 888, y: 999 }]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..f73dceae08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static #method([,]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision.js
new file mode 100644
index 0000000000..b6506e84f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-elision.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Elision advances iterator (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([,]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-empty.js
new file mode 100644
index 0000000000..2cc78eb9f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static #method([]) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..c8f1b9efd5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([...[x, y, z]]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([3, 4, 5]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..d61b97db94
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,117 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element containing an elision (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([...[,]]) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(g());
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..a46d70d623
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static #method([...[]]) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(iter);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..c6846f26b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element containing a rest element (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static #method([...[...x]]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..475c18577e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Lone rest element (direct binding) (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([...x]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..917ab34be4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element following elision elements (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static #method([ , , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..c192ae73ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([, , ...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..7b15d2a86c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Lone rest element (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static #method([...x]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(values);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..953d4154bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...[ x ] = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..3b71a97181
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...x = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..f4368b970d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...{ x } = []]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..bddc3704b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...[x], y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..e402e75116
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...x, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..68e0879302
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...{ x }, y]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..71af8c6319
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([...{ length }]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([1, 2, 3]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..43524eaafd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method([7, 8, 9]);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-close.js
new file mode 100644
index 0000000000..61262ae56f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-close.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Iterator is closed when not exhausted by pattern evaluation (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: false };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static #method([x] = iter) {
+ assert.sameValue(doneCallCount, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js
new file mode 100644
index 0000000000..b2963c5fc5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-init-iter-no-close.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-init-iter-no-close.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Iterator is not closed when exhausted by pattern evaluation (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.5 Runtime Semantics: BindingInitialization
+
+ BindingPattern : ArrayBindingPattern
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
+ result).
+ [...]
+
+---*/
+var doneCallCount = 0;
+var iter = {};
+iter[Symbol.iterator] = function() {
+ return {
+ next: function() {
+ return { value: null, done: true };
+ },
+ return: function() {
+ doneCallCount += 1;
+ return {};
+ }
+ };
+};
+
+var callCount = 0;
+var C = class {
+ static #method([x] = iter) {
+ assert.sameValue(doneCallCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-name-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-name-iter-val.js
new file mode 100644
index 0000000000..24a6b0e528
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-name-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-name-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding with normal value iteration (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
new file mode 100644
index 0000000000..cd7d7cd565
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([[x, y, z] = [4, 5, 6]] = []) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
new file mode 100644
index 0000000000..f0d0888b48
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elem-iter.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, 8);
+ assert.sameValue(z, 9);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
new file mode 100644
index 0000000000..37a696db2d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-init.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([[,] = g()] = []) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
new file mode 100644
index 0000000000..268b8dc94f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-elision-iter.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var callCount = 0;
+function* g() {
+ callCount += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([[,] = g()] = [[]]) {
+ assert.sameValue(callCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
new file mode 100644
index 0000000000..4e5bc015d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-init.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+
+---*/
+var initCount = 0;
+var iterCount = 0;
+var iter = function*() { iterCount += 1; }();
+
+var callCount = 0;
+var C = class {
+ static #method([[] = function() { initCount += 1; return iter; }()] = []) {
+ assert.sameValue(initCount, 1);
+ assert.sameValue(iterCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
new file mode 100644
index 0000000000..625d3b28bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-empty-iter.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static #method([[] = function() { initCount += 1; }()] = [[23]]) {
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
new file mode 100644
index 0000000000..cad429e7a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-init.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+
+var callCount = 0;
+var C = class {
+ static #method([[...x] = values] = []) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
new file mode 100644
index 0000000000..80490293c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-ary-rest-iter.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with array binding pattern and initializer is not used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ [...]
+ e. Else,
+ i. Let v be IteratorValue(next).
+ [...]
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+var values = [2, 1, 3];
+var initCount = 0;
+
+var callCount = 0;
+var C = class {
+ static #method([[...x] = function() { initCount += 1; }()] = [values]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x[0], 2);
+ assert.sameValue(x[1], 1);
+ assert.sameValue(x[2], 3);
+ assert.sameValue(x.length, 3);
+ assert.notSameValue(x, values);
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
new file mode 100644
index 0000000000..9aac8df6fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-exhausted.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an exhausted iterator (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x = 23] = []) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..0d8cfef27a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-arrow.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to arrow functions (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([arrow = () => {}] = []) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
new file mode 100644
index 0000000000..06d30788ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..ecdf5cf59a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-cover.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([cover = (function () {}), xCover = (0, function() {})] = []) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..8863eb80f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-fn.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([fn = function () {}, xFn = function x() {}] = []) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..3c6c97cd77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-fn-name-gen.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([gen = function* () {}, xGen = function* x() {}] = []) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
new file mode 100644
index 0000000000..a3c6280fe0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-hole.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer with a "hole" (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ SingleNameBinding : BindingIdentifier Initializeropt
+ [...] 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x = 23] = [,]) {
+ assert.sameValue(x, 23);
+ // another statement
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
new file mode 100644
index 0000000000..9bd0a9c2e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-skipped.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
new file mode 100644
index 0000000000..a0dd6aaaf6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-init-undef.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer with an undefined value (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ [...]
+ 7. If environment is undefined, return PutValue(lhs, v).
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x = 23] = [undefined]) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
new file mode 100644
index 0000000000..f0936a5425
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-complete.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration completes (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
new file mode 100644
index 0000000000..cc962a3284
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-done.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ [...]
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([_, x] = []) {
+ assert.sameValue(x, undefined);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
new file mode 100644
index 0000000000..2267648790
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val-array-prototype.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val-array-prototype.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Array destructuring uses overriden Array.prototype[Symbol.iterator] (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializer_opt
+
+ 1. Let bindingId be StringValue of BindingIdentifier.
+ 2. Let lhs be ? ResolveBinding(bindingId, environment).
+ 3. If iteratorRecord.[[Done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord).
+ b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[Done]] to true.
+ e. Else,
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.
+ iii. ReturnIfAbrupt(v).
+ [...]
+ 7. Return InitializeReferencedBinding(lhs, v).
+
+---*/
+Array.prototype[Symbol.iterator] = function* () {
+ if (this.length > 0) {
+ yield this[0];
+ }
+ if (this.length > 1) {
+ yield this[1];
+ }
+ if (this.length > 2) {
+ yield 42;
+ }
+};
+
+var callCount = 0;
+var C = class {
+ static #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 42);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
new file mode 100644
index 0000000000..a9d65e6cba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-id-iter-val.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding when value iteration was completed previously (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([x, y, z] = [1, 2, 3]) {
+ assert.sameValue(x, 1);
+ assert.sameValue(y, 2);
+ assert.sameValue(z, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
new file mode 100644
index 0000000000..71b2e932cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id-init.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
+ assert.sameValue(x, 44);
+ assert.sameValue(y, 55);
+ assert.sameValue(z, 66);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js
new file mode 100644
index 0000000000..65deee3ff9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-id.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
+ assert.sameValue(x, 11);
+ assert.sameValue(y, 22);
+ assert.sameValue(z, 33);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
new file mode 100644
index 0000000000..a3e30d2faa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id-init.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
+ assert.sameValue(v, 444);
+ assert.sameValue(x, 555);
+ assert.sameValue(z, 666);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
new file mode 100644
index 0000000000..d9598ca4c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elem-obj-prop-id.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: BindingElement with object binding pattern and initializer is not used (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingElement : BindingPatternInitializer opt
+
+ [...]
+ 2. If iteratorRecord.[[done]] is true, let v be undefined.
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be ? GetValue(defaultValue).
+ 4. Return the result of performing BindingInitialization of BindingPattern
+ with v and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
+ assert.sameValue(v, 777);
+ assert.sameValue(x, 888);
+ assert.sameValue(z, 999);
+
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js
new file mode 100644
index 0000000000..6bcd87ec81
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision-exhausted.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Elision accepts exhausted iterator (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ [...]
+ 2. Return NormalCompletion(empty).
+
+---*/
+var iter = function*() {}();
+iter.next();
+
+var callCount = 0;
+var C = class {
+ static #method([,] = iter) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js
new file mode 100644
index 0000000000..8fbb1ab3f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-elision.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Elision advances iterator (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([,] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js
new file mode 100644
index 0000000000..17095f6e41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-empty.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: No iteration occurs for an "empty" array binding pattern (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static #method([] = iter) {
+ assert.sameValue(iterations, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js
new file mode 100644
index 0000000000..596b59775e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elem.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element containing an array BindingElementList pattern (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 4. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ e. Else,
+ [...]
+ i. Let v be IteratorValue(next).
+ ii. If v is an abrupt completion, set
+ iteratorRecord.[[done]] to true.
+ iii. ReturnIfAbrupt(v).
+ 5. If iteratorRecord.[[done]] is true, let v be undefined.
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([...[x, y, z]] = [3, 4, 5]) {
+ assert.sameValue(x, 3);
+ assert.sameValue(y, 4);
+ assert.sameValue(z, 5);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js
new file mode 100644
index 0000000000..13fb5dbd78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-elision.js
@@ -0,0 +1,117 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element containing an elision (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ Elision ]
+
+ 1. Return the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
+ as the argument.
+
+ 12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
+
+ Elision : ,
+
+ 1. If iteratorRecord.[[done]] is false, then
+ a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
+ b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
+ c. ReturnIfAbrupt(next).
+ d. If next is false, set iteratorRecord.[[done]] to true.
+ 2. Return NormalCompletion(empty).
+
+---*/
+var first = 0;
+var second = 0;
+function* g() {
+ first += 1;
+ yield;
+ second += 1;
+};
+
+var callCount = 0;
+var C = class {
+ static #method([...[,]] = g()) {
+ assert.sameValue(first, 1);
+ assert.sameValue(second, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js
new file mode 100644
index 0000000000..55f75939cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-empty.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element containing an "empty" array pattern (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ ArrayBindingPattern : [ ]
+
+ 1. Return NormalCompletion(empty).
+
+---*/
+var iterations = 0;
+var iter = function*() {
+ iterations += 1;
+}();
+
+var callCount = 0;
+var C = class {
+ static #method([...[]] = iter) {
+ assert.sameValue(iterations, 1);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js
new file mode 100644
index 0000000000..ba997ecde2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-ary-rest.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element containing a rest element (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static #method([...[...x]] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js
new file mode 100644
index 0000000000..accb4ffb14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-direct.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-direct.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Lone rest element (direct binding) (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingIdentifier
+
+ [...]
+ 2. Let A be ! ArrayCreate(0).
+ 3. Let n be 0.
+ 4. Repeat,
+ [...]
+ f. Perform ! CreateDataPropertyOrThrow(A, ! ToString(n), nextValue).
+ g. Set n to n + 1.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([...x] = [1]) {
+ assert(Array.isArray(x));
+ assert.compareArray(x, [1]);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js
new file mode 100644
index 0000000000..062d0d8ecf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-elision.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-elision.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element following elision elements (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ ArrayBindingPattern : [ Elisionopt BindingRestElement ]
+ 1. If Elision is present, then
+ a. Let status be the result of performing
+ IteratorDestructuringAssignmentEvaluation of Elision with
+ iteratorRecord as the argument.
+ b. ReturnIfAbrupt(status).
+ 2. Return the result of performing IteratorBindingInitialization for
+ BindingRestElement with iteratorRecord and environment as arguments.
+---*/
+var values = [1, 2, 3, 4, 5];
+
+var callCount = 0;
+var C = class {
+ static #method([ , , ...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 3);
+ assert.sameValue(x[1], 4);
+ assert.sameValue(x[2], 5);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
new file mode 100644
index 0000000000..aa8aade22c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id-exhausted.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: RestElement applied to an exhausted iterator (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [Symbol.iterator, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
+ environment).
+ 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. If environment is undefined, return PutValue(lhs, A).
+ ii. Return InitializeReferencedBinding(lhs, A).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([, , ...x] = [1, 2]) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js
new file mode 100644
index 0000000000..02da34ecec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Lone rest element (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+ BindingRestElement : ... BindingIdentifier
+ [...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
+ [...]
+ f. Let status be CreateDataProperty(A, ToString (n), nextValue).
+ [...]
+---*/
+var values = [1, 2, 3];
+
+var callCount = 0;
+var C = class {
+ static #method([...x] = values) {
+ assert(Array.isArray(x));
+ assert.sameValue(x.length, 3);
+ assert.sameValue(x[0], 1);
+ assert.sameValue(x[1], 2);
+ assert.sameValue(x[2], 3);
+ assert.notSameValue(x, values);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js
new file mode 100644
index 0000000000..e5f11aad3f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element (nested array pattern) does not support initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...[ x ] = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js
new file mode 100644
index 0000000000..340b737d24
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element (identifier) does not support initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...x = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js
new file mode 100644
index 0000000000..c2279a320f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-init-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-init-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element (nested object pattern) does not support initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...{ x } = []] = []) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
new file mode 100644
index 0000000000..ab362b4861
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-ary.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element (array binding pattern) may not be followed by any element (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...[x], y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js
new file mode 100644
index 0000000000..b9144e0c77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-id.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element (identifier) may not be followed by any element (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...x, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
new file mode 100644
index 0000000000..611f764948
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-not-final-obj.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element (object binding pattern) may not be followed by any element (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+ ArrayBindingPattern[Yield] :
+ [ Elisionopt BindingRestElement[?Yield]opt ]
+ [ BindingElementList[?Yield] ]
+ [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+var C = class {
+ static #method([...{ x }, y] = [1, 2, 3]) {
+
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js
new file mode 100644
index 0000000000..9193c5c7e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method([...{ length }] = [1, 2, 3]) {
+ assert.sameValue(length, 3);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
new file mode 100644
index 0000000000..b30a7400f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-ary-ptrn-rest-obj-prop-id.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest element containing an object binding pattern (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+let length = "outer";
+
+var callCount = 0;
+var C = class {
+ static #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
+ assert.sameValue(v, 7);
+ assert.sameValue(w, 8);
+ assert.sameValue(x, 9);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 3);
+
+ assert.sameValue(length, "outer", "the length prop is not set as a binding name");
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js
new file mode 100644
index 0000000000..90549daa4f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static #method({} = obj) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..950ab923b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ arrow = () => {} } = {}) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..357694094b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..57f737d515
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..df3294e427
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ fn = function () {}, xFn = function x() {} } = {}) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..676b7e0443
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ gen = function* () {}, xGen = function* x() {} } = {}) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..302c1665bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static #method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..58eb4a4faa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x, } = { x: 23 }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..59dc6178b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: [x, y, z] = [4, 5, 6] } = {}) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..4625e11839
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: [y], } = { x: [45] }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..0ef4ce85ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-ary.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: [x, y, z] = [4, 5, 6] } = { w: [7, undefined, ] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..3c943a93ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() } = { s: null, u: 0, w: false, y: '' }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..35dbf36f78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: y = 33 } = { }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..501fe21151
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: y, } = { x: 23 }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..5dc2edbddc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: y } = { x: 23 }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..d9c4a8f0bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: undefined }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..5a6a5e7a13
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-prop-obj.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: { x: undefined, z: 7 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..ec3a74fd4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-getter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static #method({...x} = { get v() { count++; return 2; } }) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..16bcb4812d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static #method({...rest} = o) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..3030b77057
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-dflt-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static-dflt.template
+/*---
+description: Rest object contains just unextracted data (private static class expression method (default parameter))
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding, default-parameters]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-empty.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-empty.js
new file mode 100644
index 0000000000..78a1f1492f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-empty.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-empty.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: No property access occurs for an "empty" object binding pattern (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Runtime Semantics: BindingInitialization
+
+ ObjectBindingPattern : { }
+
+ 1. Return NormalCompletion(empty).
+---*/
+var accessCount = 0;
+var obj = Object.defineProperty({}, 'attr', {
+ get: function() {
+ accessCount += 1;
+ }
+});
+
+var callCount = 0;
+var C = class {
+ static #method({}) {
+ assert.sameValue(accessCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(obj);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js
new file mode 100644
index 0000000000..11e0f5391c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-arrow.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to arrow functions (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ arrow = () => {} }) {
+ assert.sameValue(arrow.name, 'arrow');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js
new file mode 100644
index 0000000000..1fca78fee5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" classes (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } }) {
+ assert.sameValue(cls.name, 'cls');
+ assert.notSameValue(xCls.name, 'xCls');
+ assert.notSameValue(xCls2.name, 'xCls2');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js
new file mode 100644
index 0000000000..d956047af9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-cover.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ cover = (function () {}), xCover = (0, function() {}) }) {
+ assert.sameValue(cover.name, 'cover');
+ assert.notSameValue(xCover.name, 'xCover');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js
new file mode 100644
index 0000000000..efa67a22da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-fn.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" functions (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ fn = function () {}, xFn = function x() {} }) {
+ assert.sameValue(fn.name, 'fn');
+ assert.notSameValue(xFn.name, 'xFn');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js
new file mode 100644
index 0000000000..e8458f0398
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-fn-name-gen.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: SingleNameBinding assigns name to "anonymous" generator functions (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ d. If IsAnonymousFunctionDefinition(Initializer) is true, then
+ i. Let hasNameProperty be HasOwnProperty(v, "name").
+ ii. ReturnIfAbrupt(hasNameProperty).
+ iii. If hasNameProperty is false, perform SetFunctionName(v,
+ bindingId).
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ gen = function* () {}, xGen = function* x() {} }) {
+ assert.sameValue(gen.name, 'gen');
+ assert.notSameValue(xGen.name, 'xGen');
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js
new file mode 100644
index 0000000000..975dea2cb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-init-skipped.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ [...]
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static #method({ w = counter(), x = counter(), y = counter(), z = counter() }) {
+ assert.sameValue(w, null);
+ assert.sameValue(x, 0);
+ assert.sameValue(y, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: null, x: 0, y: false, z: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js
new file mode 100644
index 0000000000..4c2266b931
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-id-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x, }) {
+ assert.sameValue(x, 23);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js
new file mode 100644
index 0000000000..4050a9040e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern using initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js
new file mode 100644
index 0000000000..38cb19d92c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary-trailing-comma.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: [y], }) {
+ assert.sameValue(y,45);
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: [45] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary.js
new file mode 100644
index 0000000000..0e13ecee3c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-ary.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-ary.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" array binding pattern not using initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: [x, y, z] = [4, 5, 6] }) {
+ assert.sameValue(x, 7);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, undefined);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: [7, undefined, ] });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js
new file mode 100644
index 0000000000..789774c3a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init-skipped.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init-skipped.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Destructuring initializer is not evaluated when value is not `undefined` (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ BindingElement : BindingPattern Initializeropt
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+---*/
+var initCount = 0;
+function counter() {
+ initCount += 1;
+}
+
+var callCount = 0;
+var C = class {
+ static #method({ s: t = counter(), u: v = counter(), w: x = counter(), y: z = counter() }) {
+ assert.sameValue(t, null);
+ assert.sameValue(v, 0);
+ assert.sameValue(x, false);
+ assert.sameValue(z, '');
+ assert.sameValue(initCount, 0);
+
+ assert.throws(ReferenceError, function() {
+ s;
+ });
+ assert.throws(ReferenceError, function() {
+ u;
+ });
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ assert.throws(ReferenceError, function() {
+ y;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ s: null, u: 0, w: false, y: '' });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js
new file mode 100644
index 0000000000..f1ca7a64c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-init.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Binding as specified via property name, identifier, and initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: y = 33 }) {
+ assert.sameValue(y, 33);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js
new file mode 100644
index 0000000000..25c3639a11
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id-trailing-comma.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id-trailing-comma.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Trailing comma is allowed following BindingPropertyList (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ ObjectBindingPattern[Yield] :
+ { }
+ { BindingPropertyList[?Yield] }
+ { BindingPropertyList[?Yield] , }
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: y, }) {
+ assert.sameValue(y, 23);
+
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id.js
new file mode 100644
index 0000000000..02e983d680
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-id.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-id.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Binding as specified via property name and identifier (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 8. Return InitializeReferencedBinding(lhs, v).
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ x: y }) {
+ assert.sameValue(y, 23);
+ assert.throws(ReferenceError, function() {
+ x;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ x: 23 });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js
new file mode 100644
index 0000000000..96bb5dac99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj-init.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj-init.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern using initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, 4);
+ assert.sameValue(y, 5);
+ assert.sameValue(z, 6);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: undefined });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj.js
new file mode 100644
index 0000000000..558a46a699
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-prop-obj.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-prop-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Object binding pattern with "nested" object binding pattern not using initializer (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
+
+ [...]
+ 3. If Initializer is present and v is undefined, then
+ [...]
+ 4. Return the result of performing BindingInitialization for BindingPattern
+ passing v and environment as arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
+ assert.sameValue(x, undefined);
+ assert.sameValue(y, undefined);
+ assert.sameValue(z, 7);
+
+ assert.throws(ReferenceError, function() {
+ w;
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ w: { x: undefined, z: 7 } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-getter.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-getter.js
new file mode 100644
index 0000000000..98902ce234
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-getter.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-getter.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Getter is called when obj is being deconstructed to a rest Object (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var count = 0;
+
+var callCount = 0;
+var C = class {
+ static #method({...x}) {
+ assert.sameValue(count, 1);
+
+ verifyProperty(x, "v", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({ get v() { count++; return 2; } });
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js
new file mode 100644
index 0000000000..37d5610eaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-skip-non-enumerable.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest object doesn't contain non-enumerable properties (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+var o = {a: 3, b: 4};
+Object.defineProperty(o, "x", { value: 4, enumerable: false });
+
+var callCount = 0;
+var C = class {
+ static #method({...rest}) {
+ assert.sameValue(rest.x, undefined);
+
+ verifyProperty(rest, "a", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 3
+ });
+
+ verifyProperty(rest, "b", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 4
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method(o);
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js
new file mode 100644
index 0000000000..0851614249
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/private-meth-static-obj-ptrn-rest-val-obj.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/obj-ptrn-rest-val-obj.case
+// - src/dstr-binding/default/cls-expr-private-meth-static.template
+/*---
+description: Rest object contains just unextracted data (private static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [object-rest, class, class-static-methods-private, destructuring-binding]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static #method({a, b, ...rest}) {
+ assert.sameValue(rest.a, undefined);
+ assert.sameValue(rest.b, undefined);
+
+ verifyProperty(rest, "x", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 1
+ });
+
+ verifyProperty(rest, "y", {
+ enumerable: true,
+ writable: true,
+ configurable: true,
+ value: 2
+ });
+ callCount = callCount + 1;
+ }
+
+ static get method() {
+ return this.#method;
+ }
+};
+
+C.method({x: 1, y: 2, a: 5, b: 3});
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/dstr/shell.js b/js/src/tests/test262/language/expressions/class/dstr/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/dstr/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-names.js
new file mode 100644
index 0000000000..e6793241ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-names.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Computed property names (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-symbol-names.js
new file mode 100644
index 0000000000..9dcb10f5e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-computed-symbol-names.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Computed property symbol names (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ *m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..ccbbdc8a8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names-asi.js
new file mode 100644
index 0000000000..b313766c52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names-asi.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Literal property names with ASI (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names.js
new file mode 100644
index 0000000000..00afc67d5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-literal-names.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Literal property names (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ *m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-field-usage.js
new file mode 100644
index 0000000000..ce477748a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-field-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-getter-usage.js
new file mode 100644
index 0000000000..481ac0010c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-getter-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-usage.js
new file mode 100644
index 0000000000..2dd77f6fb0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-method-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-names.js
new file mode 100644
index 0000000000..c48f362fa7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-private-names.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: private names (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..c3c9b7309a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier-initializer.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier.js
new file mode 100644
index 0000000000..ac1b2c850c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-field-identifier.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter-alt.js
new file mode 100644
index 0000000000..f4acc0f482
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter.js
new file mode 100644
index 0000000000..88d5fcbc6e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-getter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method-alt.js
new file mode 100644
index 0000000000..af0dc3a9e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method.js
new file mode 100644
index 0000000000..eb067ac41e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-method.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter-alt.js
new file mode 100644
index 0000000000..572c64a590
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter.js
new file mode 100644
index 0000000000..9a6d298a62
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-private-setter.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..17d9bf31c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-alt.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..90faf845e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..ce887fc209
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier-initializer.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier.js
new file mode 100644
index 0000000000..e37d28e0c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-privatename-identifier.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..903011d59d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..6ee96c16e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..3061c3aea8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..8706c5ffc8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..300e04fe3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,124 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..023835a511
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..f8b63f14db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..6cc63f1706
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-method-privatename-identifier.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..b03e2e6987
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..025a6cb3de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..a8ace0ebb1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..087aba9e0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..36c6c5bbed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..5733b8d437
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..5783deda5f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-rs-static-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-fields.js
new file mode 100644
index 0000000000..4c4ee7b758
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-fields.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: static private fields (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..85c63adb6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods-with-fields.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: static private methods with fields (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods.js
new file mode 100644
index 0000000000..95411fa58b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-static-private-methods.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: static private methods (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-string-literal-names.js
new file mode 100644
index 0000000000..d5d8ec313b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-gen-string-literal-names.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-gen.template
+/*---
+description: String literal names (field definitions after a generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ *m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-names.js
new file mode 100644
index 0000000000..2b58ea04ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-names.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Computed property names (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-symbol-names.js
new file mode 100644
index 0000000000..5d16e5a1b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-computed-symbol-names.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Computed property symbol names (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..a93d0c7216
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names-asi.js
new file mode 100644
index 0000000000..95cb640581
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names-asi.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Literal property names with ASI (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names.js
new file mode 100644
index 0000000000..408945606e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-literal-names.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Literal property names (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-field-usage.js
new file mode 100644
index 0000000000..d95585119e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-field-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..5d77d1a4d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-getter-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-usage.js
new file mode 100644
index 0000000000..d7e5d2f6a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-method-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-names.js
new file mode 100644
index 0000000000..20a1af5477
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-private-names.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: private names (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..a560e2742f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier-initializer.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier.js
new file mode 100644
index 0000000000..dd63b13308
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-field-identifier.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..f02aeb7b13
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter.js
new file mode 100644
index 0000000000..274029073f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-getter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..0b081de646
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method.js
new file mode 100644
index 0000000000..2d2f665134
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-method.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..3d9383ce5e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter.js
new file mode 100644
index 0000000000..3250df6ed0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-private-setter.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..546e1cc17d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..60414d1677
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..57905a2b70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..bb067471b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-privatename-identifier.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..ddc0583ba7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..7b37ed65f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..0a0bebd3f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..c79dea0569
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..86d5ddd732
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,124 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..f0ed80125c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..b1ece2b414
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..64ae3bd0d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..ae491fe9db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..69b7331586
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..ab8cbd24f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..da1178baf4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..8eadfb9ff4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..5be9136796
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..7a2574ef97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-rs-static-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-fields.js
new file mode 100644
index 0000000000..2345147bbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-fields.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: static private fields (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..9f7f6ff8f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods-with-fields.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: static private methods with fields (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods.js
new file mode 100644
index 0000000000..1619208681
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-static-private-methods.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: static private methods (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-string-literal-names.js
new file mode 100644
index 0000000000..a5c4cb1f00
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-method-string-literal-names.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-method.template
+/*---
+description: String literal names (field definitions after a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-names.js
new file mode 100644
index 0000000000..b4241f26e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-names.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Computed property names (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ static async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-symbol-names.js
new file mode 100644
index 0000000000..3d933059c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-computed-symbol-names.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Computed property symbol names (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ static async *m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+ );
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..33a900091a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.o(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names-asi.js
new file mode 100644
index 0000000000..300940616f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names-asi.js
@@ -0,0 +1,93 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Literal property names with ASI (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names.js
new file mode 100644
index 0000000000..fcb9dbd3e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-literal-names.js
@@ -0,0 +1,112 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Literal property names (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ static async *m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-field-usage.js
new file mode 100644
index 0000000000..5289ba78e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-field-usage.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-getter-usage.js
new file mode 100644
index 0000000000..9c448baa7a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-getter-usage.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-usage.js
new file mode 100644
index 0000000000..1d6b759b17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-method-usage.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-names.js
new file mode 100644
index 0000000000..11d6d9b8fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-private-names.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: private names (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(c.x(), 42, "test 7");
+ assert.sameValue(c.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..109fce2be0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier-initializer.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier.js
new file mode 100644
index 0000000000..f2ce5c6a1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-field-identifier.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ c.$ = 1;
+ c._ = 1;
+ c.\u{6F} = 1;
+ c.\u2118 = 1;
+ c.ZW_\u200C_NJ = 1;
+ c.ZW_\u200D_J = 1;
+
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter-alt.js
new file mode 100644
index 0000000000..4ce4dab6c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter-alt.js
@@ -0,0 +1,144 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter.js
new file mode 100644
index 0000000000..26f0ba713a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-getter.js
@@ -0,0 +1,144 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method-alt.js
new file mode 100644
index 0000000000..6a541b704c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method-alt.js
@@ -0,0 +1,143 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method.js
new file mode 100644
index 0000000000..556636b027
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-method.js
@@ -0,0 +1,143 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter-alt.js
new file mode 100644
index 0000000000..d711216e1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter-alt.js
@@ -0,0 +1,143 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter.js
new file mode 100644
index 0000000000..b313ade473
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-private-setter.js
@@ -0,0 +1,143 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..ac49206025
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..3566ac3edc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,119 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.℘(), 1);
+ assert.sameValue(c.ZW_‌_NJ(), 1);
+ assert.sameValue(c.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..85ed65eb08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier-initializer.js
@@ -0,0 +1,119 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.\u2118(), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(), 1);
+ assert.sameValue(c.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier.js
new file mode 100644
index 0000000000..1e84f6fa70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-privatename-identifier.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..285f0c9701
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,151 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..daed275746
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,152 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..26d3ad88b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,151 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..8b9aedf50f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,152 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..59349be2ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.o([1]).next().value, 1);
+ assert.sameValue(C.℘([1]).next().value, 1);
+ assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..99e2825684
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,141 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.\u{6F}([1]).next().value, 1);
+ assert.sameValue(C.\u2118([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..d9fe54e0b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..c64ca474f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-method-privatename-identifier.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..492be6f7fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,126 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..7d0d463843
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,126 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..aa31544f20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,126 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..33d6b24dd1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..fd93bf9c5f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..66a3013c65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.\u2118(), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(), 1);
+ assert.sameValue(C.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..3980ec1f44
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-rs-static-privatename-identifier.js
@@ -0,0 +1,126 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-fields.js
new file mode 100644
index 0000000000..87ec818532
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-fields.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: static private fields (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..5a9ff27fa6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods-with-fields.js
@@ -0,0 +1,104 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: static private methods with fields (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 13");
+ assert.sameValue(C.y(), 43, "test 14");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods.js
new file mode 100644
index 0000000000..af15a6cd2b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-static-private-methods.js
@@ -0,0 +1,91 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: static private methods (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 86, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-string-literal-names.js
new file mode 100644
index 0000000000..6473ed15d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-gen-string-literal-names.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-gen.template
+/*---
+description: String literal names (field definitions after a static async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static async *m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-names.js
new file mode 100644
index 0000000000..241b81f484
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-names.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Computed property names (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ static async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-symbol-names.js
new file mode 100644
index 0000000000..eafb540029
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-computed-symbol-names.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Computed property symbol names (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ static async m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+ );
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..34f3fa821c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,124 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.o(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names-asi.js
new file mode 100644
index 0000000000..4554b1d311
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names-asi.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Literal property names with ASI (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names.js
new file mode 100644
index 0000000000..83ccaeb48a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-literal-names.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Literal property names (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ static async m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-field-usage.js
new file mode 100644
index 0000000000..c4b3e4f547
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-field-usage.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..9950f35f42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-getter-usage.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-usage.js
new file mode 100644
index 0000000000..350021fd3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-method-usage.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-names.js
new file mode 100644
index 0000000000..6d8b9e9880
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-private-names.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: private names (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(c.x(), 42, "test 7");
+ assert.sameValue(c.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..1762c2eb55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier-initializer.js
@@ -0,0 +1,102 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid FieldDefinition (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier.js
new file mode 100644
index 0000000000..f7aca519f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-field-identifier.js
@@ -0,0 +1,109 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid FieldDefinition (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ c.$ = 1;
+ c._ = 1;
+ c.\u{6F} = 1;
+ c.\u2118 = 1;
+ c.ZW_\u200C_NJ = 1;
+ c.ZW_\u200D_J = 1;
+
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..8b0fa49b3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter-alt.js
@@ -0,0 +1,143 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter.js
new file mode 100644
index 0000000000..e96cf0800a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-getter.js
@@ -0,0 +1,143 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..548d6cdac1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method-alt.js
@@ -0,0 +1,142 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method.js
new file mode 100644
index 0000000000..ea9262ed44
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-method.js
@@ -0,0 +1,142 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..f96db4a77c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter-alt.js
@@ -0,0 +1,142 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter.js
new file mode 100644
index 0000000000..d1a1964a1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-private-setter.js
@@ -0,0 +1,142 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..2bfcd9fbfc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,124 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..5b973ac647
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,118 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.℘(), 1);
+ assert.sameValue(c.ZW_‌_NJ(), 1);
+ assert.sameValue(c.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..840498d488
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,118 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.\u2118(), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(), 1);
+ assert.sameValue(c.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..3850316196
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-privatename-identifier.js
@@ -0,0 +1,124 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..1fde2a2d99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,150 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..9e2290cdc8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,151 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..25f5ea4609
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,150 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..d236eaab0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,151 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..eafb052e80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,139 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.o([1]).next().value, 1);
+ assert.sameValue(C.℘([1]).next().value, 1);
+ assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..9fcfc00c32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.\u{6F}([1]).next().value, 1);
+ assert.sameValue(C.\u2118([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..e1f74411e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..f7ad830edb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..227d92efc2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..17a982d70c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..b00b065a1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..5f3775a3e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,119 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..1db09a2355
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,119 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..f82d5557cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,119 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.\u2118(), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(), 1);
+ assert.sameValue(C.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..b310c826e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-rs-static-privatename-identifier.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-fields.js
new file mode 100644
index 0000000000..92d8117e87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-fields.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: static private fields (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..7860ed890a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods-with-fields.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: static private methods with fields (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 13");
+ assert.sameValue(C.y(), 43, "test 14");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods.js
new file mode 100644
index 0000000000..5ba0e21df1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-static-private-methods.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: static private methods (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 86, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-string-literal-names.js
new file mode 100644
index 0000000000..decb1b6d9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-async-method-string-literal-names.js
@@ -0,0 +1,124 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-async-method.template
+/*---
+description: String literal names (field definitions after a static async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static async m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+C.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-names.js
new file mode 100644
index 0000000000..b7dda110d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-names.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Computed property names (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ static *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-symbol-names.js
new file mode 100644
index 0000000000..9f35e85621
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-computed-symbol-names.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Computed property symbol names (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ static *m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..7a6ad3b5a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names-asi.js
new file mode 100644
index 0000000000..0221870853
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names-asi.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Literal property names with ASI (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names.js
new file mode 100644
index 0000000000..486c47e3d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-literal-names.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Literal property names (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ static *m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-field-usage.js
new file mode 100644
index 0000000000..abad3c2d3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-field-usage.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-getter-usage.js
new file mode 100644
index 0000000000..247e897d84
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-getter-usage.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-usage.js
new file mode 100644
index 0000000000..9607bf13cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-method-usage.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-names.js
new file mode 100644
index 0000000000..0d5b4f0b8f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-private-names.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: private names (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..f39ea44690
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier-initializer.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier.js
new file mode 100644
index 0000000000..3fefc3a364
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-field-identifier.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter-alt.js
new file mode 100644
index 0000000000..3f0e6875ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter-alt.js
@@ -0,0 +1,131 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter.js
new file mode 100644
index 0000000000..3972b6ac03
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-getter.js
@@ -0,0 +1,131 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method-alt.js
new file mode 100644
index 0000000000..c8b4e19fec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method-alt.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method.js
new file mode 100644
index 0000000000..c356edac95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-method.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter-alt.js
new file mode 100644
index 0000000000..226d096633
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter-alt.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter.js
new file mode 100644
index 0000000000..3d7c74aad6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-private-setter.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..7b8c6460d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-alt.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..dc3b6596d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..829e0fe7d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier-initializer.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier.js
new file mode 100644
index 0000000000..844e3228c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-privatename-identifier.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..7933e0adb0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..33adc21980
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..82c1a434b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..5a23900ca9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..191df82493
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..7b491d4818
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..c5e11f4919
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..1848007932
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-method-privatename-identifier.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..f9f969d4fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..f07a05a2f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..2bdc1b4a05
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..c3771848bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..4a4bb988d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..457a226fbf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..6260adcd15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-rs-static-privatename-identifier.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-fields.js
new file mode 100644
index 0000000000..afc5fb8559
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-fields.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: static private fields (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..17e918ef5d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods-with-fields.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: static private methods with fields (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods.js
new file mode 100644
index 0000000000..df09f54982
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-static-private-methods.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: static private methods (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, generators, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-string-literal-names.js
new file mode 100644
index 0000000000..db619b279e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-gen-string-literal-names.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-gen.template
+/*---
+description: String literal names (field definitions after a static generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static *m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m().next().value, 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-names.js
new file mode 100644
index 0000000000..55fd32f560
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-names.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Computed property names (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ static m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-symbol-names.js
new file mode 100644
index 0000000000..d47ca6ad01
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-computed-symbol-names.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Computed property symbol names (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ static m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..a331df80b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names-asi.js
new file mode 100644
index 0000000000..4c3e5b4d15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names-asi.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Literal property names with ASI (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names.js
new file mode 100644
index 0000000000..d91b6856d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-literal-names.js
@@ -0,0 +1,99 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Literal property names (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ static m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-field-usage.js
new file mode 100644
index 0000000000..f20eae12bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-field-usage.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..9fc93d2618
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-getter-usage.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-usage.js
new file mode 100644
index 0000000000..412242540d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-method-usage.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-names.js
new file mode 100644
index 0000000000..d907c65196
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-private-names.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: private names (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..8650f4e3c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier-initializer.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid FieldDefinition (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier.js
new file mode 100644
index 0000000000..aca339ca7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-field-identifier.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid FieldDefinition (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..c18aa36535
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter-alt.js
@@ -0,0 +1,131 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter.js
new file mode 100644
index 0000000000..b9ea784033
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-getter.js
@@ -0,0 +1,131 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..f2c645fc64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method-alt.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method.js
new file mode 100644
index 0000000000..a01f6c1edb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-method.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..a89e61525c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter-alt.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter.js
new file mode 100644
index 0000000000..895b5a135c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-private-setter.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..48f2f3ad76
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..4da8e30e0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..6aa01ab455
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..35c2dc64ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-privatename-identifier.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..1a2ec06a0d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..1f8f9986be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..39dfe2bf38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..93a81cbbc2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..6182eed7ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..ffcb933f3c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..d5c432e8c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..8548e9ace7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..be203c5790
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..d06ca9f33c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..a5d49fb781
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..c745533ea1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..594b8a82cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..dbbcc4a193
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..b31c77d25f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-rs-static-privatename-identifier.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: Valid Static PrivateName (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-fields.js
new file mode 100644
index 0000000000..f08caebce1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-fields.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: static private fields (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..039b57f9b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods-with-fields.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: static private methods with fields (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods.js
new file mode 100644
index 0000000000..a729bfafb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-static-private-methods.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: static private methods (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-string-literal-names.js
new file mode 100644
index 0000000000..956c3f244f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/after-same-line-static-method-string-literal-names.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-static-method.template
+/*---
+description: String literal names (field definitions after a static method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert.sameValue(C.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
+ "m doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(C, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..a2111e7654
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-arrow-body.template
+/*---
+description: super.x in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; () => super.x;');
+};
+
+new C().x();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..b4e85f9217
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-arrow-body.template
+/*---
+description: super['x'] in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; () => super["x"];');
+};
+
+new C().x();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..eeb377e07f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-arrow-body.template
+/*---
+description: error if `super()['x']` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; () => super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..63aaa459a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-arrow-body.template
+/*---
+description: error if `super().x` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; () => super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..1880bb650a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-direct-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-arrow-body.template
+/*---
+description: error if `super()` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; () => super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..fb49fcdf89
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-arrow-body.template
+/*---
+description: super.x in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('() => super.x;');
+};
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..da5dd3f9e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-arrow-body.template
+/*---
+description: super['x'] in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('() => super["x"];');
+};
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..69f3745ef7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `super()['x']` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('() => super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..a4c0817b78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall-2.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `super().x` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('() => super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..be90af7392
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-derived-cls-indirect-eval-err-contains-supercall.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `super()` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('() => super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-arguments.js
new file mode 100644
index 0000000000..f6f1b9d23e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-arguments.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-arguments.case
+// - src/class-elements/initializer-direct-eval-arguments/cls-expr-fields-eval-arrow-body.template
+/*---
+description: error if `arguments` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if ContainsArguments of StatementList is true.
+ ...
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+let executed = false;
+let C = class {
+ x = eval('executed = true; () => arguments;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..ecb00a1e22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-direct-eval-err-contains-newtarget.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-eval-arrow-body.template
+/*---
+description: error if `new.target` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ x = eval('executed = true; () => new.target;');
+}
+
+var c = new C();
+
+assert.sameValue(executed, true);
+assert.sameValue(c.x(), undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-indirect-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-indirect-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..03ff58e518
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-indirect-eval-err-contains-newtarget.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `new.target` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var C = class {
+ x = (0, eval)('() => new.target;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..1688a11db8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-1.js
@@ -0,0 +1,39 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: super.x in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; () => super.x;');
+ x() {
+ this.#x();
+ }
+};
+
+new C().x();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..6b32c8f02d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-contains-superproperty-2.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: super['x'] in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; () => super["x"];');
+ x() {
+ this.#x();
+ }
+};
+
+new C().x();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..33e6b44db8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: error if `super()['x']` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; () => super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..8165d97d06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: error if `super().x` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; () => super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..06d3da6bef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-direct-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: error if `super()` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; () => super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..804cb94a88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-arrow-body.template
+/*---
+description: super.x in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('() => super.x;');
+};
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..b9bf5cb0b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-arrow-body.template
+/*---
+description: super['x'] in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('() => super["x"];');
+};
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..a20d9eb5bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `super()['x']` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('() => super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..003cdbe02c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall-2.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `super().x` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('() => super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..4750182b02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-derived-cls-indirect-eval-err-contains-supercall.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `super()` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('() => super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-arguments.js
new file mode 100644
index 0000000000..e7c8fd70ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-arguments.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-arguments.case
+// - src/class-elements/initializer-direct-eval-arguments/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: error if `arguments` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if ContainsArguments of StatementList is true.
+ ...
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+var C = class {
+ #x = eval('() => arguments;');
+ x() {
+ this.#x();
+ }
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..bb84f9fc1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-direct-eval-err-contains-newtarget.js
@@ -0,0 +1,39 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-eval-arrow-body.template
+/*---
+description: error if `new.target` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = eval('executed = true; () => new.target;');
+ x() {
+ this.#x();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(executed, true);
+assert.sameValue(c.x(), undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-indirect-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-indirect-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..ccd5a591c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-body-private-indirect-eval-err-contains-newtarget.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval-arrow-body.template
+/*---
+description: error if `new.target` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var C = class {
+ #x = (0, eval)('() => new.target;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-arguments.js
new file mode 100644
index 0000000000..1ea8d75526
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-arrow-fnc.template
+/*---
+description: Syntax error if `arguments` used in class field (arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-super.js
new file mode 100644
index 0000000000..10c7a3642a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/arrow-fnc-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-arrow-fnc.template
+/*---
+description: Syntax error if `super()` used in class field (arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..3f8ca4cf3f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ var \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier.js
new file mode 100644
index 0000000000..24436319e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ var await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..4f95c19f08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ void \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference.js
new file mode 100644
index 0000000000..c50105b76c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ void await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..127563f959
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ \u0061wait: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier.js
new file mode 100644
index 0000000000..f5987e9846
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/await-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ await: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/browser.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/shell.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..d9f795e532
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..f1a94682e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..85aa88b1d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..8a0c99c5cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..216c7ba70b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier.js
new file mode 100644
index 0000000000..6ea3e23f3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *#gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..c96c901955
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,76 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-spread-strict.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [object-spread, async-iteration, class-static-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..423b5d8ebe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-identifier-strict-strict.js
@@ -0,0 +1,67 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-strict.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-catch.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-catch.js
new file mode 100644
index 0000000000..9df90877c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-catch.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-catch.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}).catch(rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+});
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-async-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-async-iterator.js
new file mode 100644
index 0000000000..4f163520d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-async-iterator.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-async-iterator.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: yield * [Promise.reject(value)] is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ for await (let line of readFile()) {
+ yield line;
+ }
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js
new file mode 100644
index 0000000000..6128c0caf6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-sync-iterator.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: yield Promise.reject(value) in for-await-of is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ for await (let value of iterable) {
+ yield value;
+ }
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-async-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-async-iterator.js
new file mode 100644
index 0000000000..54596c20f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-async-iterator.js
@@ -0,0 +1,76 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-async-iterator.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield * readFile();
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}, $DONE).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-sync-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-sync-iterator.js
new file mode 100644
index 0000000000..18fc3891cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next-yield-star-sync-iterator.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-sync-iterator.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield * iterable;
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next.js
new file mode 100644
index 0000000000..0757ff050b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-promise-reject-next.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..0f048066cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-multiple.js
@@ -0,0 +1,78 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-multiple.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield [...yield yield];
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+
+item.then(({ done, value }) => {
+ item = iter.next(value);
+
+ item.then(({ done, value }) => {
+ assert.compareArray(value, arr);
+ assert.sameValue(done, false);
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-single.js
new file mode 100644
index 0000000000..ec1ed01193
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-arr-single.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-single.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield [...yield];
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next(false);
+var item = iter.next(arr);
+
+item.then(({ done, value }) => {
+ assert.notSameValue(value, arr, 'value is a new array');
+ assert(Array.isArray(value), 'value is an Array exotic object');
+ assert.sameValue(value.length, 3)
+ assert.sameValue(value[0], 'a');
+ assert.sameValue(value[1], 'b');
+ assert.sameValue(value[2], 'c');
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-obj.js
new file mode 100644
index 0000000000..783d71c5e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-spread-obj.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-obj.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Use yield value in a object spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [object-spread, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+item.then(({ done, value }) => {
+ assert.sameValue(value.x, 42);
+ assert.sameValue(value.y, 39);
+ assert.sameValue(Object.keys(value).length, 2);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-next.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-next.js
new file mode 100644
index 0000000000..2d343b2a6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-next.js
@@ -0,0 +1,247 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-next.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Execution order for yield* with async iterator and next() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({ name: "get [Symbol.iterator]" });
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({
+ name: "get [Symbol.asyncIterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.asyncIterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-promise-1",
+ get then() {
+ log.push({
+ name: "get next then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "next-promise-2",
+ get then() {
+ log.push({
+ name: "get next then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+ assert.sameValue(log[1].thisValue, obj, "get [Symbol.asyncIterator] thisValue");
+
+ assert.sameValue(log[2].name, "call [Symbol.asyncIterator]");
+ assert.sameValue(log[2].thisValue, obj, "[Symbol.asyncIterator] thisValue");
+ assert.sameValue(log[2].args.length, 0, "[Symbol.asyncIterator] args.length");
+
+ assert.sameValue(log[3].name, "get next");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "get next thisValue");
+
+ assert.sameValue(log[4].name, "call next");
+ assert.sameValue(log[4].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[4].args.length, 1, "next args.length");
+ assert.sameValue(log[4].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[5].name, "get next then (1)");
+ assert.sameValue(log[5].thisValue.name, "next-promise-1", "get next then thisValue");
+
+ assert.sameValue(log[6].name, "call next then (1)");
+ assert.sameValue(log[6].thisValue.name, "next-promise-1", "next then thisValue");
+ assert.sameValue(log[6].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[6].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[6].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[7].name, "get next done (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[8].name, "get next value (1)");
+ assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 9, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[9].name, "call next");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[9].args.length, 1, "next args.length");
+ assert.sameValue(log[9].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[10].name, "get next then (2)");
+ assert.sameValue(log[10].thisValue.name, "next-promise-2", "get next then thisValue");
+
+ assert.sameValue(log[11].name, "call next then (2)");
+ assert.sameValue(log[11].thisValue.name, "next-promise-2", "next then thisValue");
+ assert.sameValue(log[11].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[12].name, "get next done (2)");
+ assert.sameValue(log[12].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[13].name, "get next value (2)");
+ assert.sameValue(log[13].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-return.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-return.js
new file mode 100644
index 0000000000..f4d12ed865
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-return.js
@@ -0,0 +1,263 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-return.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: execution order for yield* with async iterator and return() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, Symbol.asyncIterator, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. If generatorKind is async, then set value to ? Await(value).
+ 3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
+ ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var returnCount = 0;
+ return {
+ name: 'asyncIterator',
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-promise-1",
+ get then() {
+ log.push({
+ name: "get return then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "return-promise-2",
+ get then() {
+ log.push({
+ name: "get return then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return then (1)");
+ assert.sameValue(log[4].thisValue.name, "return-promise-1", "get return then thisValue");
+
+ assert.sameValue(log[5].name, "call return then (1)");
+ assert.sameValue(log[5].thisValue.name, "return-promise-1", "return then thisValue");
+ assert.sameValue(log[5].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[6].name, "get return done (1)");
+ assert.sameValue(log[6].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[7].name, "get return value (1)");
+ assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.return("return-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get return");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[9].name, "call return");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[9].args.length, 1, "return args.length");
+ assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
+
+ assert.sameValue(log[10].name, "get return then (2)");
+ assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
+
+ assert.sameValue(log[11].name, "call return then (2)");
+ assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
+ assert.sameValue(log[11].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[12].name, "get return done (2)");
+ assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[13].name, "get return value (2)");
+ assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 14, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-throw.js
new file mode 100644
index 0000000000..9f76846665
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-async-throw.js
@@ -0,0 +1,271 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: execution order for yield* with async iterator and throw() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, Symbol.asyncIterator, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Let resultValue be Return ? IteratorValue(innerResult).
+ b. If generatorKind is async, then set resultValue to ? Await(resultValue).
+ c. Return resultValue.
+ 7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var throwCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-promise-1",
+ get then() {
+ log.push({
+ name: "get throw then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "throw-promise-2",
+ get then() {
+ log.push({
+ name: "get throw then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw then (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-promise-1", "get throw thisValue");
+
+ assert.sameValue(log[5].name, "call throw then (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-promise-1", "throw thisValue");
+ assert.sameValue(log[5].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[6].name, "get throw done (1)");
+ assert.sameValue(log[6].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[7].name, "get throw value (1)");
+ assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.throw("throw-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get throw");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[9].name, "call throw");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[9].args.length, 1, "throw args.length");
+ assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
+
+ assert.sameValue(log[10].name, "get throw then (2)");
+ assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
+
+ assert.sameValue(log[11].name, "call throw then (2)");
+ assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
+ assert.sameValue(log[11].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[12].name, "get throw done (2)");
+ assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[13].name, "get throw value (2)");
+ assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-expr-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-expr-abrupt.js
new file mode 100644
index 0000000000..3d73d7315f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-expr-abrupt.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-expr-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting yield* operand (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ ...
+
+---*/
+var obj = {};
+var abrupt = function() {
+ throw obj;
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* abrupt();
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, obj, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-get-abrupt.js
new file mode 100644
index 0000000000..784503fb80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-get-abrupt.js
@@ -0,0 +1,102 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ get [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..71d50f65cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-boolean-throw.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-number-throw.js
new file mode 100644
index 0000000000..5de34b9ee4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-number-throw.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-object-throw.js
new file mode 100644
index 0000000000..56592c1091
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-object-throw.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-string-throw.js
new file mode 100644
index 0000000000..ea0829a669
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-string-throw.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..277628ab2d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-not-callable-symbol-throw.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: Symbol.asyncIterator
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-null-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-null-sync-get-abrupt.js
new file mode 100644
index 0000000000..8898f3ddb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-null-sync-get-abrupt.js
@@ -0,0 +1,107 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-null-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting @@iterator after null @@asyncIterator (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-abrupt.js
new file mode 100644
index 0000000000..6bff8d1d92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-abrupt.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while calling [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-boolean-throw.js
new file mode 100644
index 0000000000..7cfd7fc69d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-boolean-throw.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-null-throw.js
new file mode 100644
index 0000000000..1e2d457b76
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-null-throw.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-number-throw.js
new file mode 100644
index 0000000000..ffd1d953a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-number-throw.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return 42;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-string-throw.js
new file mode 100644
index 0000000000..4060d0e54c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-string-throw.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return '42';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-symbol-throw.js
new file mode 100644
index 0000000000..1be034b525
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-symbol-throw.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return Symbol.asyncIterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-undefined-throw.js
new file mode 100644
index 0000000000..24af35bc84
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-returns-undefined-throw.js
@@ -0,0 +1,98 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js
new file mode 100644
index 0000000000..c1d4963c35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js
@@ -0,0 +1,107 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-undefined-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting @@iterator after undefined @@asyncIterator (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-get-abrupt.js
new file mode 100644
index 0000000000..7364a8c0b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-get-abrupt.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting [Symbol.iterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..441c8a32d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-number-throw.js
new file mode 100644
index 0000000000..646629deff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-number-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-object-throw.js
new file mode 100644
index 0000000000..863fbf077e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-object-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-string-throw.js
new file mode 100644
index 0000000000..640679c740
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-string-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..6175821e12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: Symbol.iterator
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-abrupt.js
new file mode 100644
index 0000000000..de9f7bf0e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-abrupt.js
@@ -0,0 +1,95 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while calling [Symbol.iterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-boolean-throw.js
new file mode 100644
index 0000000000..cda0d916df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-boolean-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-null-throw.js
new file mode 100644
index 0000000000..a98ff89c1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-null-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-number-throw.js
new file mode 100644
index 0000000000..e7b344e30b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-number-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return 0;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-string-throw.js
new file mode 100644
index 0000000000..81836b9ca6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-string-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return '';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-symbol-throw.js
new file mode 100644
index 0000000000..551a7712fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-symbol-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return Symbol.iterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-undefined-throw.js
new file mode 100644
index 0000000000..d6b006914a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-getiter-sync-returns-undefined-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-done-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-done-get-abrupt.js
new file mode 100644
index 0000000000..d03c95b342
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-done-get-abrupt.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-done-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting done (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get done() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-returns-abrupt.js
new file mode 100644
index 0000000000..9e5e8d02e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-returns-abrupt.js
@@ -0,0 +1,93 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while calling next (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-value-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-value-get-abrupt.js
new file mode 100644
index 0000000000..830c4430fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-value-get-abrupt.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-value-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ done: true,
+ get value() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-get-abrupt.js
new file mode 100644
index 0000000000..16b4a22664
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-get-abrupt.js
@@ -0,0 +1,93 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Abrupt completion while getting next (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ get next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-non-object-ignores-then.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-non-object-ignores-then.js
new file mode 100644
index 0000000000..a83568852e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-non-object-ignores-then.js
@@ -0,0 +1,113 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-non-object-ignores-then.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: If next() value is not-object, do not access respective then property (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+
+---*/
+Number.prototype.then = function() {
+ throw new Test262Error('Number#then should not be used');
+};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return 42;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, 'TypeError');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..b3cc1e2f7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-boolean-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: true
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-null-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-null-throw.js
new file mode 100644
index 0000000000..bec8d9404f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-null-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-null-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: null
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-number-throw.js
new file mode 100644
index 0000000000..50f09af20a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-number-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: 42
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-object-throw.js
new file mode 100644
index 0000000000..fec694d6d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-object-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - object (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: {}
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-string-throw.js
new file mode 100644
index 0000000000..94208916de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-string-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: ''
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..e3566b58ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-symbol-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: Symbol('oi')
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-undefined-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-undefined-throw.js
new file mode 100644
index 0000000000..ae164d199b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-not-callable-undefined-throw.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-undefined-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Not-callable next value in a yield star position - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: undefined
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-get-abrupt.js
new file mode 100644
index 0000000000..1ff423c11c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-get-abrupt.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-get-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Return abrupt after getting next().then (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js
new file mode 100644
index 0000000000..e2e117e81b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-boolean-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: true,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js
new file mode 100644
index 0000000000..54d2cb0b2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-null-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (null) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: null,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js
new file mode 100644
index 0000000000..7dc8a9f960
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-number-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: 39,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js
new file mode 100644
index 0000000000..c5cc194848
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-object-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: {},
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js
new file mode 100644
index 0000000000..94838e59b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-string-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: '',
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js
new file mode 100644
index 0000000000..0596acdd87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-symbol-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: Symbol('oi'),
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js
new file mode 100644
index 0000000000..1dfea5caeb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-undefined-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (undefined) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: undefined,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-returns-abrupt.js
new file mode 100644
index 0000000000..bf2c426571
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-returns-abrupt.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: Return abrupt after calling next().then (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-next.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-next.js
new file mode 100644
index 0000000000..b09f5368a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-next.js
@@ -0,0 +1,250 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-next.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: execution order for yield* with sync iterator and next() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ 5. Let received be NormalCompletion(undefined).
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ vii. Let received be GeneratorYield(innerResult).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.next ( value )
+
+ ...
+ 5. Let nextResult be IteratorNext(syncIterator, value).
+ ...
+ 7. Let nextValue be IteratorValue(nextResult).
+ ...
+ 9. Let nextDone be IteratorComplete(nextResult).
+ ...
+ 12. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « nextValue »).
+ ...
+ 14. Set onFulfilled.[[Done]] to nextDone.
+ 15. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+ Async Iterator Value Unwrap Functions
+
+ 1. Return ! CreateIterResultObject(value, F.[[Done]]).
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({
+ name: "get [Symbol.iterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.iterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ };
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({ name: "get [Symbol.asyncIterator]" });
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+
+ assert.sameValue(log[2].name, "get [Symbol.iterator]");
+ assert.sameValue(log[2].thisValue, obj, "get [Symbol.iterator] thisValue");
+
+ assert.sameValue(log[3].name, "call [Symbol.iterator]");
+ assert.sameValue(log[3].thisValue, obj, "[Symbol.iterator] thisValue");
+ assert.sameValue(log[3].args.length, 0, "[Symbol.iterator] args.length");
+
+ assert.sameValue(log[4].name, "get next");
+ assert.sameValue(log[4].thisValue.name, "syncIterator", "get next thisValue");
+
+ assert.sameValue(log[5].name, "call next");
+ assert.sameValue(log[5].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[5].args.length, 1, "next args.length");
+ assert.sameValue(log[5].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[6].name, "get next done (1)");
+ assert.sameValue(log[6].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[7].name, "get next value (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[8].name, "call next");
+ assert.sameValue(log[8].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[8].args.length, 1, "next args.length");
+ assert.sameValue(log[8].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[9].name, "get next done (2)");
+ assert.sameValue(log[9].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[10].name, "get next value (2)");
+ assert.sameValue(log[10].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[11].name, "after yield*");
+ assert.sameValue(log[11].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 12, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-return.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-return.js
new file mode 100644
index 0000000000..5584d3cc0b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-return.js
@@ -0,0 +1,225 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-return.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: execution order for yield* with sync iterator and return() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator,
+ « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to
+ ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. Return Completion{[[Type]]: return, [[Value]]: value,
+ [[Target]]: empty}.
+ ix. Let received be GeneratorYield(innerResult).
+
+ %AsyncFromSyncIteratorPrototype%.return ( value )
+
+ 5. Let return be GetMethod(syncIterator, "return").
+ ...
+ ...
+ 8. Let returnResult be Call(return, syncIterator, « value »).
+ ...
+ 11. Let returnValue be IteratorValue(returnResult).
+ ..
+ 13. Let returnDone be IteratorComplete(returnResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined, « returnValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to returnDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var returnCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return done (1)");
+ assert.sameValue(log[4].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[5].name, "get return value (1)");
+ assert.sameValue(log[5].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.return().then(v => {
+ assert.sameValue(log[6].name, "get return");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[7].name, "call return");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "get return thisValue");
+ assert.sameValue(log[7].args.length, 1, "return args.length");
+ assert.sameValue(log[7].args[0], undefined, "return args[0]");
+
+ assert.sameValue(log[8].name, "get return done (2)");
+ assert.sameValue(log[8].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[9].name, "get return value (2)");
+ assert.sameValue(log[9].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 10, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-throw.js
new file mode 100644
index 0000000000..af20dc75d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method-static/yield-star-sync-throw.js
@@ -0,0 +1,231 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-throw.case
+// - src/async-generators/default/async-class-expr-static-private-method.template
+/*---
+description: execution order for yield* with sync iterator and throw() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Return ? IteratorValue(innerResult).
+ 7. Let received be GeneratorYield(innerResult).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.throw ( value )
+
+ ...
+ 5. Let throw be GetMethod(syncIterator, "throw").
+ ...
+ 8. Let throwResult be Call(throw, syncIterator, « value »).
+ ...
+ 11. Let throwValue be IteratorValue(throwResult).
+ ...
+ 13. Let throwDone be IteratorComplete(throwResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « throwValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to throwDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var throwCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ static async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw done (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[5].name, "get throw value (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.throw().then(v => {
+ assert.sameValue(log[6].name, "get throw");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[7].name, "call throw");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[7].args.length, 1, "throw args.length");
+ assert.sameValue(log[7].args[0], undefined, "throw args[0]");
+
+ assert.sameValue(log[8].name, "get throw done (2)");
+ assert.sameValue(log[8].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[9].name, "get throw value (2)");
+ assert.sameValue(log[9].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[10].name, "after yield*");
+ assert.sameValue(log[10].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 11, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..410026b54c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ var \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier.js
new file mode 100644
index 0000000000..7f91c235a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ var await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..1f8a30aa76
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ void \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference.js
new file mode 100644
index 0000000000..1b05701442
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ void await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..b9d0ac1f9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ \u0061wait: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier.js
new file mode 100644
index 0000000000..eb41bc2824
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/await-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/await-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ await: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/browser.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/shell.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..6219aa5d0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..2c87a125d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-binding-identifier.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..5b4f4da3b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference-escaped.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..7e4a13eff2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-identifier-reference.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..8fe6a577fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier-escaped.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier.js
new file mode 100644
index 0000000000..7120178147
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-as-label-identifier.case
+// - src/async-generators/syntax/async-class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { async *#gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..7cf65d294e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,86 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-spread-strict.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [object-spread, async-iteration, class-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..b398eda103
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-identifier-strict-strict.js
@@ -0,0 +1,77 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-strict.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-catch.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-catch.js
new file mode 100644
index 0000000000..d38cf76fdc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-catch.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-catch.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}).catch(rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+});
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-async-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-async-iterator.js
new file mode 100644
index 0000000000..10f8623b68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-async-iterator.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-async-iterator.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: yield * [Promise.reject(value)] is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ for await (let line of readFile()) {
+ yield line;
+ }
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-sync-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-sync-iterator.js
new file mode 100644
index 0000000000..186f7fd24e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-for-await-of-sync-iterator.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-for-await-of-sync-iterator.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: yield Promise.reject(value) in for-await-of is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ for await (let value of iterable) {
+ yield value;
+ }
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-async-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-async-iterator.js
new file mode 100644
index 0000000000..40ca201f43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-async-iterator.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-async-iterator.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+async function * readFile() {
+ yield Promise.reject(error);
+ yield "unreachable";
+}
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield * readFile();
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}, $DONE).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-sync-iterator.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-sync-iterator.js
new file mode 100644
index 0000000000..61ebf36c58
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next-yield-star-sync-iterator.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next-yield-star-sync-iterator.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+let iterable = [
+ Promise.reject(error),
+ "unreachable"
+];
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield * iterable;
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next.js
new file mode 100644
index 0000000000..105feec6c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-promise-reject-next.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-promise-reject-next.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+let error = new Error();
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield Promise.reject(error);
+ yield "unreachable";
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error("Promise incorrectly resolved.");
+}, rejectValue => {
+ // yield Promise.reject(error);
+ assert.sameValue(rejectValue, error);
+
+ iter.next().then(({done, value}) => {
+ // iter is closed now.
+ assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
+ assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..a0a79ab9a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-multiple.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-multiple.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Use yield value in a array spread position (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield [...yield yield];
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+
+item.then(({ done, value }) => {
+ item = iter.next(value);
+
+ item.then(({ done, value }) => {
+ assert.compareArray(value, arr);
+ assert.sameValue(done, false);
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-single.js
new file mode 100644
index 0000000000..6b780cc32e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-arr-single.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-single.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Use yield value in a array spread position (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield [...yield];
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next(false);
+var item = iter.next(arr);
+
+item.then(({ done, value }) => {
+ assert.notSameValue(value, arr, 'value is a new array');
+ assert(Array.isArray(value), 'value is an Array exotic object');
+ assert.sameValue(value.length, 3)
+ assert.sameValue(value[0], 'a');
+ assert.sameValue(value[1], 'b');
+ assert.sameValue(value[2], 'c');
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-obj.js
new file mode 100644
index 0000000000..164c876bd1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-spread-obj.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-obj.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Use yield value in a object spread position (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [object-spread, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+item.then(({ done, value }) => {
+ assert.sameValue(value.x, 42);
+ assert.sameValue(value.y, 39);
+ assert.sameValue(Object.keys(value).length, 2);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-next.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-next.js
new file mode 100644
index 0000000000..e4a1d873c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-next.js
@@ -0,0 +1,257 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-next.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Execution order for yield* with async iterator and next() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({ name: "get [Symbol.iterator]" });
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({
+ name: "get [Symbol.asyncIterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.asyncIterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-promise-1",
+ get then() {
+ log.push({
+ name: "get next then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "next-promise-2",
+ get then() {
+ log.push({
+ name: "get next then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call next then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+ assert.sameValue(log[1].thisValue, obj, "get [Symbol.asyncIterator] thisValue");
+
+ assert.sameValue(log[2].name, "call [Symbol.asyncIterator]");
+ assert.sameValue(log[2].thisValue, obj, "[Symbol.asyncIterator] thisValue");
+ assert.sameValue(log[2].args.length, 0, "[Symbol.asyncIterator] args.length");
+
+ assert.sameValue(log[3].name, "get next");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "get next thisValue");
+
+ assert.sameValue(log[4].name, "call next");
+ assert.sameValue(log[4].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[4].args.length, 1, "next args.length");
+ assert.sameValue(log[4].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[5].name, "get next then (1)");
+ assert.sameValue(log[5].thisValue.name, "next-promise-1", "get next then thisValue");
+
+ assert.sameValue(log[6].name, "call next then (1)");
+ assert.sameValue(log[6].thisValue.name, "next-promise-1", "next then thisValue");
+ assert.sameValue(log[6].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[6].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[6].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[7].name, "get next done (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[8].name, "get next value (1)");
+ assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 9, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[9].name, "call next");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "next thisValue");
+ assert.sameValue(log[9].args.length, 1, "next args.length");
+ assert.sameValue(log[9].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[10].name, "get next then (2)");
+ assert.sameValue(log[10].thisValue.name, "next-promise-2", "get next then thisValue");
+
+ assert.sameValue(log[11].name, "call next then (2)");
+ assert.sameValue(log[11].thisValue.name, "next-promise-2", "next then thisValue");
+ assert.sameValue(log[11].args.length, 2, "next then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "next then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "next then args[1]");
+
+ assert.sameValue(log[12].name, "get next done (2)");
+ assert.sameValue(log[12].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[13].name, "get next value (2)");
+ assert.sameValue(log[13].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-return.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-return.js
new file mode 100644
index 0000000000..7000493ebd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-return.js
@@ -0,0 +1,273 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-return.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: execution order for yield* with async iterator and return() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, Symbol.asyncIterator, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. If generatorKind is async, then set value to ? Await(value).
+ 3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
+ ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var returnCount = 0;
+ return {
+ name: 'asyncIterator',
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-promise-1",
+ get then() {
+ log.push({
+ name: "get return then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "return-promise-2",
+ get then() {
+ log.push({
+ name: "get return then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call return then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return then (1)");
+ assert.sameValue(log[4].thisValue.name, "return-promise-1", "get return then thisValue");
+
+ assert.sameValue(log[5].name, "call return then (1)");
+ assert.sameValue(log[5].thisValue.name, "return-promise-1", "return then thisValue");
+ assert.sameValue(log[5].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[6].name, "get return done (1)");
+ assert.sameValue(log[6].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[7].name, "get return value (1)");
+ assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.return("return-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get return");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
+
+ assert.sameValue(log[9].name, "call return");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
+ assert.sameValue(log[9].args.length, 1, "return args.length");
+ assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
+
+ assert.sameValue(log[10].name, "get return then (2)");
+ assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
+
+ assert.sameValue(log[11].name, "call return then (2)");
+ assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
+ assert.sameValue(log[11].args.length, 2, "return then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
+
+ assert.sameValue(log[12].name, "get return done (2)");
+ assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[13].name, "get return value (2)");
+ assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 14, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-throw.js
new file mode 100644
index 0000000000..08be1d64dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-async-throw.js
@@ -0,0 +1,281 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-async-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: execution order for yield* with async iterator and throw() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, Symbol.asyncIterator, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Let resultValue be Return ? IteratorValue(innerResult).
+ b. If generatorKind is async, then set resultValue to ? Await(resultValue).
+ c. Return resultValue.
+ 7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
+ ...
+
+ AsyncGeneratorYield ( value )
+
+ ...
+ 8. Return ! AsyncGeneratorResolve(generator, value, false).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.asyncIterator]() {
+ var throwCount = 0;
+ return {
+ name: "asyncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-promise-1",
+ get then() {
+ log.push({
+ name: "get throw then (1)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (1)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ });
+ };
+ }
+ };
+ }
+
+ return {
+ name: "throw-promise-2",
+ get then() {
+ log.push({
+ name: "get throw then (2)",
+ thisValue: this
+ });
+ return function(resolve) {
+ log.push({
+ name: "call throw then (2)",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ resolve({
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ });
+ };
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw then (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-promise-1", "get throw thisValue");
+
+ assert.sameValue(log[5].name, "call throw then (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-promise-1", "throw thisValue");
+ assert.sameValue(log[5].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[5].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[5].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[6].name, "get throw done (1)");
+ assert.sameValue(log[6].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[7].name, "get throw value (1)");
+ assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.throw("throw-arg-2").then(v => {
+ assert.sameValue(log[8].name, "get throw");
+ assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
+
+ assert.sameValue(log[9].name, "call throw");
+ assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
+ assert.sameValue(log[9].args.length, 1, "throw args.length");
+ assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
+
+ assert.sameValue(log[10].name, "get throw then (2)");
+ assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
+
+ assert.sameValue(log[11].name, "call throw then (2)");
+ assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
+ assert.sameValue(log[11].args.length, 2, "throw then args.length");
+ assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
+ assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
+
+ assert.sameValue(log[12].name, "get throw done (2)");
+ assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[13].name, "get throw value (2)");
+ assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[14].name, "after yield*");
+ assert.sameValue(log[14].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 15, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-expr-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-expr-abrupt.js
new file mode 100644
index 0000000000..ceb9bd1100
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-expr-abrupt.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-expr-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting yield* operand (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ ...
+
+---*/
+var obj = {};
+var abrupt = function() {
+ throw obj;
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* abrupt();
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, obj, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-get-abrupt.js
new file mode 100644
index 0000000000..573b57ecf0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-get-abrupt.js
@@ -0,0 +1,112 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting [Symbol.asyncIterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ get [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..a21cc806df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-boolean-throw.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (boolean) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-number-throw.js
new file mode 100644
index 0000000000..45ed2fcc1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-number-throw.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (number) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-object-throw.js
new file mode 100644
index 0000000000..07b343cb60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-object-throw.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (object) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-string-throw.js
new file mode 100644
index 0000000000..e53a9905f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-string-throw.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (string) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..b39a457357
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-not-callable-symbol-throw.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (symbol) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ 3. If func is either undefined or null, return undefined.
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]: Symbol.asyncIterator
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-null-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-null-sync-get-abrupt.js
new file mode 100644
index 0000000000..e6051d3cba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-null-sync-get-abrupt.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-null-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting @@iterator after null @@asyncIterator (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-abrupt.js
new file mode 100644
index 0000000000..45d10b19e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-abrupt.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while calling [Symbol.asyncIterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-boolean-throw.js
new file mode 100644
index 0000000000..f0cda9f157
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-boolean-throw.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - boolean (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-null-throw.js
new file mode 100644
index 0000000000..8293f29c31
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-null-throw.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - null (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-number-throw.js
new file mode 100644
index 0000000000..3596624b42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-number-throw.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - number (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return 42;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-string-throw.js
new file mode 100644
index 0000000000..264bc311bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-string-throw.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - string (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return '42';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-symbol-throw.js
new file mode 100644
index 0000000000..7fd1978091
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-symbol-throw.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - symbol (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return Symbol.asyncIterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-undefined-throw.js
new file mode 100644
index 0000000000..53154e307f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-returns-undefined-throw.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - undefined (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ ...
+ 6. Let iterator be ? Call(method, obj).
+ 7. If Type(iterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-undefined-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-undefined-sync-get-abrupt.js
new file mode 100644
index 0000000000..c60d632138
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-async-undefined-sync-get-abrupt.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-async-undefined-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting @@iterator after undefined @@asyncIterator (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var calls = 0;
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ },
+ get [Symbol.asyncIterator]() {
+ calls += 1;
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+ assert.sameValue(calls, 1);
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-get-abrupt.js
new file mode 100644
index 0000000000..2f8c7f71d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-get-abrupt.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting [Symbol.iterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..e81202e020
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-boolean-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (boolean) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: false
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-number-throw.js
new file mode 100644
index 0000000000..bdea429935
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-number-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (number) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: 0
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-object-throw.js
new file mode 100644
index 0000000000..390cb2b13d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-object-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (object) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: {}
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-string-throw.js
new file mode 100644
index 0000000000..2f16204224
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-string-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (string) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: ''
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..ed3f1021f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-not-callable-symbol-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (symbol) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ...
+
+ GetMethod ( V, P )
+
+ ...
+ 2. Let func be ? GetV(V, P).
+ ...
+ 4. If IsCallable(func) is false, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]: Symbol.iterator
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-abrupt.js
new file mode 100644
index 0000000000..fbbe195d05
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-abrupt.js
@@ -0,0 +1,105 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while calling [Symbol.iterator] (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ [Symbol.iterator]() {
+ throw reason;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-boolean-throw.js
new file mode 100644
index 0000000000..7ba2f44a89
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-boolean-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-boolean-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - boolean (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return true;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-null-throw.js
new file mode 100644
index 0000000000..80e699cf82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-null-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-null-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - null (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-number-throw.js
new file mode 100644
index 0000000000..39a393d2f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-number-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-number-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - number (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return 0;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-string-throw.js
new file mode 100644
index 0000000000..342908f659
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-string-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-string-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - string (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return '';
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-symbol-throw.js
new file mode 100644
index 0000000000..8d3ec61cab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-symbol-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-symbol-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - symbol (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return Symbol.iterator;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-undefined-throw.js
new file mode 100644
index 0000000000..22440e788a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-getiter-sync-returns-undefined-throw.js
@@ -0,0 +1,110 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-getiter-sync-returns-undefined-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - undefined (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ 1. Let exprRef be the result of evaluating AssignmentExpression.
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ CreateAsyncFromSyncIterator(syncIterator)
+
+ 1. If Type(syncIterator) is not Object, throw a TypeError exception.
+ ...
+
+---*/
+var obj = {
+ [Symbol.iterator]() {
+ return undefined;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-done-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-done-get-abrupt.js
new file mode 100644
index 0000000000..ce0b67dc74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-done-get-abrupt.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-done-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting done (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get done() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-returns-abrupt.js
new file mode 100644
index 0000000000..676a745958
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-returns-abrupt.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while calling next (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-value-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-value-get-abrupt.js
new file mode 100644
index 0000000000..9d028dabb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-value-get-abrupt.js
@@ -0,0 +1,113 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-call-value-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting value (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ done: true,
+ get value() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-get-abrupt.js
new file mode 100644
index 0000000000..9ae2d784af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-get-abrupt.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Abrupt completion while getting next (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ get next() {
+ throw reason;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, "reject reason");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-non-object-ignores-then.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-non-object-ignores-then.js
new file mode 100644
index 0000000000..37a79a08f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-non-object-ignores-then.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-non-object-ignores-then.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: If next() value is not-object, do not access respective then property (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+
+---*/
+Number.prototype.then = function() {
+ throw new Test262Error('Number#then should not be used');
+};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return 42;
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, 'TypeError');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..d680176eb9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-boolean-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-boolean-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - boolean (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: true
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-null-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-null-throw.js
new file mode 100644
index 0000000000..3dde849046
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-null-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-null-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - null (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: null
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-number-throw.js
new file mode 100644
index 0000000000..1918d1e8be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-number-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-number-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - number (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: 42
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-object-throw.js
new file mode 100644
index 0000000000..1c4d3945bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-object-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-object-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - object (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: {}
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-string-throw.js
new file mode 100644
index 0000000000..e45d251e7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-string-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-string-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - string (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: ''
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..c939a18354
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-symbol-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-symbol-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - symbol (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: Symbol('oi')
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-undefined-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-undefined-throw.js
new file mode 100644
index 0000000000..62027c11f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-not-callable-undefined-throw.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-not-callable-undefined-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Not-callable next value in a yield star position - undefined (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next: undefined
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v.constructor, TypeError, "TypeError");
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-get-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-get-abrupt.js
new file mode 100644
index 0000000000..2f65a135d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-get-abrupt.js
@@ -0,0 +1,127 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-get-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Return abrupt after getting next().then (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ get then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js
new file mode 100644
index 0000000000..985a0321da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-boolean-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-boolean-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (boolean) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: true,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-null-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-null-fulfillpromise.js
new file mode 100644
index 0000000000..ffd3905a50
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-null-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-null-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (null) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: null,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-number-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-number-fulfillpromise.js
new file mode 100644
index 0000000000..c3bdb3497e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-number-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-number-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (number) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: 39,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-object-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-object-fulfillpromise.js
new file mode 100644
index 0000000000..fb593d2a9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-object-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-object-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (object) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: {},
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-string-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-string-fulfillpromise.js
new file mode 100644
index 0000000000..bd7b68b0ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-string-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-string-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (string) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: '',
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js
new file mode 100644
index 0000000000..f7382cf6d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-symbol-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-symbol-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (symbol) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: Symbol('oi'),
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js
new file mode 100644
index 0000000000..f7b166d3c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-non-callable-undefined-fulfillpromise.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-non-callable-undefined-fulfillpromise.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (undefined) (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ iv. If Type(innerResult) is not Object, throw a TypeError exception.
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 7. If Type(resolution) is not Object, then
+ a. Return FulfillPromise(promise, resolution).
+ 8. Let then be Get(resolution, "then").
+ ...
+ 11. If IsCallable(thenAction) is false, then
+ a. Return FulfillPromise(promise, resolution).
+ ...
+
+---*/
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then: undefined,
+ value: 42,
+ done: false
+ }
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-returns-abrupt.js
new file mode 100644
index 0000000000..8dfa62f75b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-returns-abrupt.js
@@ -0,0 +1,127 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-next-then-returns-abrupt.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: Return abrupt after calling next().then (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+ ...
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+
+ Await
+
+ ...
+ 2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
+ ...
+
+ Promise Resolve Functions
+
+ ...
+ 8. Let then be Get(resolution, "then").
+ ...
+ 10. Get thenAction be then.[[Value]].
+ ...
+ 12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
+ resolution, thenAction »).
+ ...
+
+---*/
+var reason = {};
+var obj = {
+ get [Symbol.iterator]() {
+ throw new Test262Error('it should not get Symbol.iterator');
+ },
+ [Symbol.asyncIterator]() {
+ return {
+ next() {
+ return {
+ then() {
+ throw reason;
+ }
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ yield* obj;
+ throw new Test262Error('abrupt completion closes iter');
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next().then(() => {
+ throw new Test262Error('Promise incorrectly fulfilled.');
+}, v => {
+ assert.sameValue(v, reason, 'reject reason');
+
+ iter.next().then(({ done, value }) => {
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-next.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-next.js
new file mode 100644
index 0000000000..f6e31c44d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-next.js
@@ -0,0 +1,260 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-next.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: execution order for yield* with sync iterator and next() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 2. Let value be ? GetValue(exprRef).
+ 3. Let generatorKind be ! GetGeneratorKind().
+ 4. Let iterator be ? GetIterator(value, generatorKind).
+ 5. Let received be NormalCompletion(undefined).
+ 6. Repeat
+ a. If received.[[Type]] is normal, then
+ i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
+ ii. Let innerResult be ? Invoke(iterator, "next",
+ « received.[[Value]] »).
+ iii. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ v. Let done be ? IteratorComplete(innerResult).
+ vi. If done is true, then
+ 1. Return ? IteratorValue(innerResult).
+ vii. Let received be GeneratorYield(innerResult).
+ ...
+
+ GetIterator ( obj [ , hint ] )
+
+ ...
+ 3. If hint is async,
+ a. Set method to ? GetMethod(obj, @@asyncIterator).
+ b. If method is undefined,
+ i. Let syncMethod be ? GetMethod(obj, @@iterator).
+ ii. Let syncIterator be ? Call(syncMethod, obj).
+ iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.next ( value )
+
+ ...
+ 5. Let nextResult be IteratorNext(syncIterator, value).
+ ...
+ 7. Let nextValue be IteratorValue(nextResult).
+ ...
+ 9. Let nextDone be IteratorComplete(nextResult).
+ ...
+ 12. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « nextValue »).
+ ...
+ 14. Set onFulfilled.[[Done]] to nextDone.
+ 15. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+ Async Iterator Value Unwrap Functions
+
+ 1. Return ! CreateIterResultObject(value, F.[[Done]]).
+
+---*/
+var log = [];
+var obj = {
+ get [Symbol.iterator]() {
+ log.push({
+ name: "get [Symbol.iterator]",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call [Symbol.iterator]",
+ thisValue: this,
+ args: [...arguments]
+ });
+ var nextCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({
+ name: "get next",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call next",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ nextCount++;
+ if (nextCount == 1) {
+ return {
+ name: "next-result-1",
+ get value() {
+ log.push({
+ name: "get next value (1)",
+ thisValue: this
+ });
+ return "next-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get next done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "next-result-2",
+ get value() {
+ log.push({
+ name: "get next value (2)",
+ thisValue: this
+ });
+ return "next-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get next done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ };
+ },
+ get [Symbol.asyncIterator]() {
+ log.push({ name: "get [Symbol.asyncIterator]" });
+ return null;
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next("next-arg-1").then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
+
+ assert.sameValue(log[2].name, "get [Symbol.iterator]");
+ assert.sameValue(log[2].thisValue, obj, "get [Symbol.iterator] thisValue");
+
+ assert.sameValue(log[3].name, "call [Symbol.iterator]");
+ assert.sameValue(log[3].thisValue, obj, "[Symbol.iterator] thisValue");
+ assert.sameValue(log[3].args.length, 0, "[Symbol.iterator] args.length");
+
+ assert.sameValue(log[4].name, "get next");
+ assert.sameValue(log[4].thisValue.name, "syncIterator", "get next thisValue");
+
+ assert.sameValue(log[5].name, "call next");
+ assert.sameValue(log[5].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[5].args.length, 1, "next args.length");
+ assert.sameValue(log[5].args[0], undefined, "next args[0]");
+
+ assert.sameValue(log[6].name, "get next done (1)");
+ assert.sameValue(log[6].thisValue.name, "next-result-1", "get next done thisValue");
+
+ assert.sameValue(log[7].name, "get next value (1)");
+ assert.sameValue(log[7].thisValue.name, "next-result-1", "get next value thisValue");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 8, "log.length");
+
+ iter.next("next-arg-2").then(v => {
+ assert.sameValue(log[8].name, "call next");
+ assert.sameValue(log[8].thisValue.name, "syncIterator", "next thisValue");
+ assert.sameValue(log[8].args.length, 1, "next args.length");
+ assert.sameValue(log[8].args[0], "next-arg-2", "next args[0]");
+
+ assert.sameValue(log[9].name, "get next done (2)");
+ assert.sameValue(log[9].thisValue.name, "next-result-2", "get next done thisValue");
+
+ assert.sameValue(log[10].name, "get next value (2)");
+ assert.sameValue(log[10].thisValue.name, "next-result-2", "get next value thisValue");
+
+ assert.sameValue(log[11].name, "after yield*");
+ assert.sameValue(log[11].value, "next-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 12, "log.length");
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-return.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-return.js
new file mode 100644
index 0000000000..b020558fac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-return.js
@@ -0,0 +1,235 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-return.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: execution order for yield* with sync iterator and return() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ c. Else,
+ i. Assert: received.[[Type]] is return.
+ ii. Let return be ? GetMethod(iterator, "return").
+ iii. If return is undefined, return Completion(received).
+ iv. Let innerReturnResult be ? Call(return, iterator,
+ « received.[[Value]] »).
+ v. If generatorKind is async, then set innerReturnResult to
+ ? Await(innerReturnResult).
+ ...
+ vii. Let done be ? IteratorComplete(innerReturnResult).
+ viii. If done is true, then
+ 1. Let value be ? IteratorValue(innerReturnResult).
+ 2. Return Completion{[[Type]]: return, [[Value]]: value,
+ [[Target]]: empty}.
+ ix. Let received be GeneratorYield(innerResult).
+
+ %AsyncFromSyncIteratorPrototype%.return ( value )
+
+ 5. Let return be GetMethod(syncIterator, "return").
+ ...
+ ...
+ 8. Let returnResult be Call(return, syncIterator, « value »).
+ ...
+ 11. Let returnValue be IteratorValue(returnResult).
+ ..
+ 13. Let returnDone be IteratorComplete(returnResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined, « returnValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to returnDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var returnCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get return() {
+ log.push({
+ name: "get return",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call return",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ returnCount++;
+ if (returnCount == 1) {
+ return {
+ name: "return-result-1",
+ get value() {
+ log.push({
+ name: "get return value (1)",
+ thisValue: this
+ });
+ return "return-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get return done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "return-result-2",
+ get value() {
+ log.push({
+ name: "get return value (2)",
+ thisValue: this
+ });
+ return "return-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get return done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ yield* obj;
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.return("return-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get return");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[3].name, "call return");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "return thisValue");
+ assert.sameValue(log[3].args.length, 1, "return args.length");
+ assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
+
+ assert.sameValue(log[4].name, "get return done (1)");
+ assert.sameValue(log[4].thisValue.name, "return-result-1", "get return done thisValue");
+
+ assert.sameValue(log[5].name, "get return value (1)");
+ assert.sameValue(log[5].thisValue.name, "return-result-1", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.return().then(v => {
+ assert.sameValue(log[6].name, "get return");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get return thisValue");
+
+ assert.sameValue(log[7].name, "call return");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "get return thisValue");
+ assert.sameValue(log[7].args.length, 1, "return args.length");
+ assert.sameValue(log[7].args[0], undefined, "return args[0]");
+
+ assert.sameValue(log[8].name, "get return done (2)");
+ assert.sameValue(log[8].thisValue.name, "return-result-2", "get return done thisValue");
+
+ assert.sameValue(log[9].name, "get return value (2)");
+ assert.sameValue(log[9].thisValue.name, "return-result-2", "get return value thisValue");
+
+ assert.sameValue(v.value, "return-value-2");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 10, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-throw.js b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-throw.js
new file mode 100644
index 0000000000..11305429bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-gen-private-method/yield-star-sync-throw.js
@@ -0,0 +1,241 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-star-sync-throw.case
+// - src/async-generators/default/async-class-expr-private-method.template
+/*---
+description: execution order for yield* with sync iterator and throw() (Async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorPrivateMethod
+features: [Symbol.iterator, async-iteration, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ YieldExpression: yield * AssignmentExpression
+
+ ...
+ 6. Repeat
+ ...
+ b. Else if received.[[Type]] is throw, then
+ i. Let throw be ? GetMethod(iterator, "throw").
+ ii. If throw is not undefined, then
+ 1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
+ 2. If generatorKind is async, then set innerResult to
+ ? Await(innerResult).
+ ...
+ 5. Let done be ? IteratorComplete(innerResult).
+ 6. If done is true, then
+ a. Return ? IteratorValue(innerResult).
+ 7. Let received be GeneratorYield(innerResult).
+ ...
+
+ %AsyncFromSyncIteratorPrototype%.throw ( value )
+
+ ...
+ 5. Let throw be GetMethod(syncIterator, "throw").
+ ...
+ 8. Let throwResult be Call(throw, syncIterator, « value »).
+ ...
+ 11. Let throwValue be IteratorValue(throwResult).
+ ...
+ 13. Let throwDone be IteratorComplete(throwResult).
+ ...
+ 16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
+ « throwValue »).
+ ...
+ 18. Set onFulfilled.[[Done]] to throwDone.
+ 19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
+ onFulfilled, undefined, promiseCapability).
+ ...
+
+---*/
+var log = [];
+var obj = {
+ [Symbol.iterator]() {
+ var throwCount = 0;
+ return {
+ name: "syncIterator",
+ get next() {
+ log.push({ name: "get next" });
+ return function() {
+ return {
+ value: "next-value-1",
+ done: false
+ };
+ };
+ },
+ get throw() {
+ log.push({
+ name: "get throw",
+ thisValue: this
+ });
+ return function() {
+ log.push({
+ name: "call throw",
+ thisValue: this,
+ args: [...arguments]
+ });
+
+ throwCount++;
+ if (throwCount == 1) {
+ return {
+ name: "throw-result-1",
+ get value() {
+ log.push({
+ name: "get throw value (1)",
+ thisValue: this
+ });
+ return "throw-value-1";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (1)",
+ thisValue: this
+ });
+ return false;
+ }
+ };
+ }
+
+ return {
+ name: "throw-result-2",
+ get value() {
+ log.push({
+ name: "get throw value (2)",
+ thisValue: this
+ });
+ return "throw-value-2";
+ },
+ get done() {
+ log.push({
+ name: "get throw done (2)",
+ thisValue: this
+ });
+ return true;
+ }
+ };
+ };
+ }
+ };
+ }
+};
+
+
+
+var callCount = 0;
+
+var C = class {
+ async *#gen() {
+ callCount += 1;
+ log.push({ name: "before yield*" });
+ var v = yield* obj;
+ log.push({
+ name: "after yield*",
+ value: v
+ });
+ return "return-value";
+
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+assert.sameValue(log.length, 0, "log.length");
+
+iter.next().then(v => {
+ assert.sameValue(log[0].name, "before yield*");
+
+ assert.sameValue(log[1].name, "get next");
+
+ assert.sameValue(v.value, "next-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 2, "log.length");
+
+ iter.throw("throw-arg-1").then(v => {
+ assert.sameValue(log[2].name, "get throw");
+ assert.sameValue(log[2].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[3].name, "call throw");
+ assert.sameValue(log[3].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[3].args.length, 1, "throw args.length");
+ assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
+
+ assert.sameValue(log[4].name, "get throw done (1)");
+ assert.sameValue(log[4].thisValue.name, "throw-result-1", "get throw done thisValue");
+
+ assert.sameValue(log[5].name, "get throw value (1)");
+ assert.sameValue(log[5].thisValue.name, "throw-result-1", "get throw value thisValue");
+
+ assert.sameValue(v.value, "throw-value-1");
+ assert.sameValue(v.done, false);
+
+ assert.sameValue(log.length, 6, "log.length");
+
+ iter.throw().then(v => {
+ assert.sameValue(log[6].name, "get throw");
+ assert.sameValue(log[6].thisValue.name, "syncIterator", "get throw thisValue");
+
+ assert.sameValue(log[7].name, "call throw");
+ assert.sameValue(log[7].thisValue.name, "syncIterator", "throw thisValue");
+ assert.sameValue(log[7].args.length, 1, "throw args.length");
+ assert.sameValue(log[7].args[0], undefined, "throw args[0]");
+
+ assert.sameValue(log[8].name, "get throw done (2)");
+ assert.sameValue(log[8].thisValue.name, "throw-result-2", "get throw done thisValue");
+
+ assert.sameValue(log[9].name, "get throw value (2)");
+ assert.sameValue(log[9].thisValue.name, "throw-result-2", "get throw value thisValue");
+
+ assert.sameValue(log[10].name, "after yield*");
+ assert.sameValue(log[10].value, "throw-value-2");
+
+ assert.sameValue(v.value, "return-value");
+ assert.sameValue(v.done, true);
+
+ assert.sameValue(log.length, 11, "log.length");
+ }).then($DONE, $DONE);
+ }).catch($DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "#gen does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "#gen does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "#gen does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..6b0596410f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async #method() {
+ var \u0061wait;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier.js
new file mode 100644
index 0000000000..8ff369d74c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-binding-identifier.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier.case
+// - src/async-functions/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async #method() {
+ var await;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..526bb7567a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference-escaped.case
+// - src/async-functions/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async #method() {
+ void \u0061wait;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference.js
new file mode 100644
index 0000000000..96fa551ff2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-identifier-reference.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference.case
+// - src/async-functions/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async #method() {
+ void await;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..d7412fc144
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async #method() {
+ \u0061wait: ;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier.js
new file mode 100644
index 0000000000..bdcd0c25b6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/await-as-label-identifier.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier.case
+// - src/async-functions/syntax/async-class-expr-static-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ static async #method() {
+ await: ;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/browser.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js
new file mode 100644
index 0000000000..bac2fc26ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-arguments-from-parent-function.case
+// - src/async-functions/evaluation/async-class-expr-static-private-method.template
+/*---
+description: Async function returns an async function. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async #method(x) {
+ let a = arguments;
+ return async () => a === arguments;
+ }
+ static async method(x) {
+ return this.#method(x);
+ }
+}
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method.bind(C);
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, true);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js
new file mode 100644
index 0000000000..faa7d9e961
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-static-private-method.template
+/*---
+description: Async function returns an async function. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async #method(x) {
+ return async () => new.target;
+ }
+ static async method(x) {
+ return this.#method(x);
+ }
+}
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method.bind(C);
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow.js
new file mode 100644
index 0000000000..552326186f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-arrow.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow.case
+// - src/async-functions/evaluation/async-class-expr-static-private-method.template
+/*---
+description: Async function returns an async function. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async #method(x) {
+ return async () => x;
+ }
+ static async method(x) {
+ return this.#method(x);
+ }
+}
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method.bind(C);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js
new file mode 100644
index 0000000000..8b8df838af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-arguments-from-own-function.case
+// - src/async-functions/evaluation/async-class-expr-static-private-method.template
+/*---
+description: Async function returns an async function. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async #method(x) {
+ let a = arguments;
+ return async function() { return a === arguments; };
+ }
+ static async method(x) {
+ return this.#method(x);
+ }
+}
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method.bind(C);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, false);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js
new file mode 100644
index 0000000000..349cecfe28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-static-private-method.template
+/*---
+description: Async function returns an async function. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async #method(x) {
+ return async function() { return new.target; };
+ }
+ static async method(x) {
+ return this.#method(x);
+ }
+}
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method.bind(C);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function.js
new file mode 100644
index 0000000000..753e69222f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/returns-async-function.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function.case
+// - src/async-functions/evaluation/async-class-expr-static-private-method.template
+/*---
+description: Async function returns an async function. (Static private async method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-static-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ static async #method(x) {
+ return async function() { return x; };
+ }
+ static async method(x) {
+ return this.#method(x);
+ }
+}
+// Stores a reference `asyncFn` for case evaluation
+let asyncFn = C.method.bind(C);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/shell.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..2ba8bcd1b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async #method() {
+ var \u0061wait;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier.js
new file mode 100644
index 0000000000..273b30b611
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-binding-identifier.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-binding-identifier.case
+// - src/async-functions/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async #method() {
+ var await;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..4a76344b29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference-escaped.case
+// - src/async-functions/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async #method() {
+ void \u0061wait;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference.js
new file mode 100644
index 0000000000..5495f088ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-identifier-reference.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-identifier-reference.case
+// - src/async-functions/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async #method() {
+ void await;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..2d6656dc25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier-escaped.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier-escaped.case
+// - src/async-functions/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async #method() {
+ \u0061wait: ;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier.js
new file mode 100644
index 0000000000..dc8394020a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/await-as-label-identifier.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/async-functions/await-as-label-identifier.case
+// - src/async-functions/syntax/async-class-expr-private-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Await] parameter and
+ StringValue of Identifier is "await".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class {
+ async #method() {
+ await: ;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/browser.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js
new file mode 100644
index 0000000000..376b7aaef1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-arguments-from-parent-function.case
+// - src/async-functions/evaluation/async-class-expr-private-method.template
+/*---
+description: Async function returns an async function. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async #method(x) {
+ let a = arguments;
+ return async () => a === arguments;
+ }
+ async method(x) {
+ return this.#method(x);
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, true);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-newtarget.js
new file mode 100644
index 0000000000..4a613f967d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow-returns-newtarget.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-private-method.template
+/*---
+description: Async function returns an async function. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async #method(x) {
+ return async () => new.target;
+ }
+ async method(x) {
+ return this.#method(x);
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn().then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow.js
new file mode 100644
index 0000000000..f60e5c30e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-arrow.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-arrow.case
+// - src/async-functions/evaluation/async-class-expr-private-method.template
+/*---
+description: Async function returns an async function. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async #method(x) {
+ return async () => x;
+ }
+ async method(x) {
+ return this.#method(x);
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-arguments-from-own-function.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-arguments-from-own-function.js
new file mode 100644
index 0000000000..304527125b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-arguments-from-own-function.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-arguments-from-own-function.case
+// - src/async-functions/evaluation/async-class-expr-private-method.template
+/*---
+description: Async function returns an async function. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async #method(x) {
+ let a = arguments;
+ return async function() { return a === arguments; };
+ }
+ async method(x) {
+ return this.#method(x);
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, false);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-newtarget.js
new file mode 100644
index 0000000000..9d711106cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function-returns-newtarget.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function-returns-newtarget.case
+// - src/async-functions/evaluation/async-class-expr-private-method.template
+/*---
+description: Async function returns an async function. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async #method(x) {
+ return async function() { return new.target; };
+ }
+ async method(x) {
+ return this.#method(x);
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, undefined);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function.js
new file mode 100644
index 0000000000..e3f819699a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/returns-async-function.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-functions/returns-async-function.case
+// - src/async-functions/evaluation/async-class-expr-private-method.template
+/*---
+description: Async function returns an async function. (Async private method as a ClassExpression element)
+esid: prod-AsyncMethod
+features: [async-functions, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ AsyncMethod
+
+ Async Function Definitions
+
+ AsyncMethod :
+ async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+---*/
+let count = 0;
+
+
+var C = class {
+ async #method(x) {
+ return async function() { return x; };
+ }
+ async method(x) {
+ return this.#method(x);
+ }
+};
+// Stores a reference `asyncFn` for case evaluation
+let c = new C();
+let asyncFn = c.method.bind(c);
+
+asyncFn(1).then(retFn => {
+ count++;
+ return retFn();
+}).then(result => {
+ assert.sameValue(result, 1);
+ assert.sameValue(count, 1);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/async-private-method/shell.js b/js/src/tests/test262/language/expressions/class/elements/async-private-method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/async-private-method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/browser.js b/js/src/tests/test262/language/expressions/class/elements/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-anonymous.js b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-anonymous.js
new file mode 100644
index 0000000000..33c989b567
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-anonymous.js
@@ -0,0 +1,28 @@
+// Copyright 2019 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ The inferred class-name is present when executing static field initializers of anonymous class expressions.
+info: |
+ 14.6.13 Runtime Semantics: ClassDefinitionEvaluation
+
+ [...]
+ 17. Perform MakeClassConstructor(F).
+ 18. If className is not undefined, then
+ a. Perform SetFunctionName(F, className).
+ [...]
+
+features: [class-static-fields-public]
+---*/
+
+var className;
+
+var C = class {
+ static f = (className = this.name);
+}
+
+assert.sameValue(className, "C");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-decl.js b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-decl.js
new file mode 100644
index 0000000000..5b7ceee987
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-decl.js
@@ -0,0 +1,28 @@
+// Copyright 2019 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ The class-name is present when executing static field initializers of class declarations.
+info: |
+ 14.6.13 Runtime Semantics: ClassDefinitionEvaluation
+
+ [...]
+ 17. Perform MakeClassConstructor(F).
+ 18. If className is not undefined, then
+ a. Perform SetFunctionName(F, className).
+ [...]
+
+features: [class-static-fields-public]
+---*/
+
+var className;
+
+class C {
+ static f = (className = this.name);
+}
+
+assert.sameValue(className, "C");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-default-export.js b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-default-export.js
new file mode 100644
index 0000000000..88ed40b12a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-default-export.js
@@ -0,0 +1,30 @@
+// |reftest| module
+// Copyright 2019 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ The class-name is present when executing static field initializers of default-exported classes.
+info: |
+ 14.6.13 Runtime Semantics: ClassDefinitionEvaluation
+
+ [...]
+ 17. Perform MakeClassConstructor(F).
+ 18. If className is not undefined, then
+ a. Perform SetFunctionName(F, className).
+ [...]
+
+flags: [module]
+features: [class-static-fields-public]
+---*/
+
+var className;
+
+export default class {
+ static f = (className = this.name);
+}
+
+assert.sameValue(className, "default");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-expr.js b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-expr.js
new file mode 100644
index 0000000000..18e743e2bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/class-name-static-initializer-expr.js
@@ -0,0 +1,28 @@
+// Copyright 2019 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ The class-name is present when executing static field initializers of named class expressions.
+info: |
+ 14.6.13 Runtime Semantics: ClassDefinitionEvaluation
+
+ [...]
+ 17. Perform MakeClassConstructor(F).
+ 18. If className is not undefined, then
+ a. Perform SetFunctionName(F, className).
+ [...]
+
+features: [class-static-fields-public]
+---*/
+
+var className;
+
+var expr = class C {
+ static f = (className = this.name);
+}
+
+assert.sameValue(className, "C");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..8cefd0f92d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-arguments.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-comp-name.template
+/*---
+description: Syntax error if `arguments` used in class field (computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ [x] = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-super.js
new file mode 100644
index 0000000000..396462cffd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/comp-name-init-err-contains-super.js
@@ -0,0 +1,29 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-comp-name.template
+/*---
+description: Syntax error if `super()` used in class field (computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ [x] = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive-symbol.js b/js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive-symbol.js
new file mode 100644
index 0000000000..e73580c7c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive-symbol.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-toprimitive-symbol.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, Symbol.toPrimitive, Symbol, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var s1 = Symbol();
+var s2 = Symbol();
+var s3 = Symbol();
+var err = function() { throw new Test262Error(); };
+var obj1 = {
+ [Symbol.toPrimitive]: function() { return s1; },
+ toString: err,
+ valueOf: err
+};
+
+var obj2 = {
+ toString: function() { return s2; },
+ valueOf: err
+};
+
+var obj3 = {
+ toString: undefined,
+ valueOf: function() { return s3; }
+};
+
+
+
+var C = class {
+ [obj1] = 42;
+ [obj2] = 43;
+ [obj3] = 44;
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, s1),
+ "s1 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, s1),
+ "s1 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, s1, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, s2),
+ "s2 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, s2),
+ "s2 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, s2, {
+ value: 43,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, s3),
+ "s3 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, s3),
+ "s3 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, s3, {
+ value: 44,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive.js b/js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive.js
new file mode 100644
index 0000000000..440f5e5961
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/computed-name-toprimitive.js
@@ -0,0 +1,120 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-toprimitive.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, Symbol.toPrimitive, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var err = function() { throw new Test262Error(); };
+var obj1 = {
+ [Symbol.toPrimitive]: function() { return "d"; },
+ toString: err,
+ valueOf: err
+};
+
+var obj2 = {
+ toString: function() { return "e"; },
+ valueOf: err
+};
+
+var obj3 = {
+ toString: undefined,
+ valueOf: function() { return "f"; }
+};
+
+
+
+var C = class {
+ [obj1] = 42;
+ [obj2] = 43;
+ [obj3] = 44;
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "e"),
+ "e doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "e"),
+ "e doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "e", {
+ value: 43,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "f"),
+ "f doesn't appear as an own property on C prototype"
+);
+assert(!
+ Object.prototype.hasOwnProperty.call(C, "f"),
+ "f doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "f", {
+ value: 44,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/ctor-called-after-fields-init.js b/js/src/tests/test262/language/expressions/class/elements/ctor-called-after-fields-init.js
new file mode 100644
index 0000000000..ba0ec47400
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/ctor-called-after-fields-init.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/ctor-called-after-fields-init.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: The constructor method is called after the fields are initalized (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ [[Construct]] ( argumentsList, newTarget)
+
+ 8. If kind is "base", then
+ a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ ...
+ ...
+ 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ ...
+
+---*/
+var ctor;
+
+
+var C = class {
+ constructor() {
+ ctor = this.foo;
+ }
+ foo = 42;
+}
+
+var c = new C();
+
+assert.sameValue(ctor, 42);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..a7e4f59cb0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval.template
+/*---
+description: super.x in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super.x;');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..043df175a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval.template
+/*---
+description: super['x'] in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super["x"];');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..566cb44a62
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval.template
+/*---
+description: error if `super()['x']` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..c435851eca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval.template
+/*---
+description: error if `super().x` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..5e78ae5e4e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-direct-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval.template
+/*---
+description: error if `super()` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..7a035c6702
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval.template
+/*---
+description: super.x in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super.x;');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..02669f2f34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-contains-superproperty-2.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval.template
+/*---
+description: super['x'] in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super["x"];');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..a78841fb21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval.template
+/*---
+description: error if `super()['x']` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..5e45a4171e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval.template
+/*---
+description: error if `super().x` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..48df895d33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/derived-cls-indirect-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval.template
+/*---
+description: error if `super()` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-arguments.js
new file mode 100644
index 0000000000..d5c6149b02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-arguments.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-arguments.case
+// - src/class-elements/initializer-direct-eval-arguments/cls-expr-fields-eval.template
+/*---
+description: error if `arguments` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if ContainsArguments of StatementList is true.
+ ...
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ x = eval('executed = true; arguments;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..2319f80f0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/direct-eval-err-contains-newtarget.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-eval.template
+/*---
+description: error if `new.target` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ x = eval('executed = true; new.target;');
+}
+
+var c = new C();
+
+assert.sameValue(executed, true);
+assert.sameValue(c.x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-arguments.js
new file mode 100644
index 0000000000..fdf3b36a1a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-equality.template
+/*---
+description: Syntax error if `arguments` used in class field (equality expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = {} == arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-super.js
new file mode 100644
index 0000000000..cac4a45c55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/equality-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-equality.template
+/*---
+description: Syntax error if `super()` used in class field (equality expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = {} == super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/browser.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-referenceerror.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-referenceerror.js
new file mode 100644
index 0000000000..001be0e567
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-referenceerror.js
@@ -0,0 +1,58 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-referenceerror.case
+// - src/class-elements/class-evaluation-error/cls-expr.template
+/*---
+description: ReferenceError evaluating a computed property name (field definitions in a class expression)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+function fn() {
+ throw new Test262Error();
+}
+
+
+
+function evaluate() {
+ var C = class {
+ [noRef] = fn();
+ };
+}
+
+assert.throws(ReferenceError, evaluate);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-err.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-err.js
new file mode 100644
index 0000000000..1ca2127180
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-err.js
@@ -0,0 +1,60 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-toprimitive-err.case
+// - src/class-elements/class-evaluation-error/cls-expr.template
+/*---
+description: Custom error evaluating a computed property name (field definitions in a class expression)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class-fields-public, computed-property-names, Symbol.toPrimitive, class]
+flags: [generated]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var obj = {
+ [Symbol.toPrimitive]: function() {
+ throw new Test262Error();
+ }
+};
+
+
+
+function evaluate() {
+ var C = class {
+ [obj]
+ };
+}
+
+assert.throws(Test262Error, evaluate);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-noncallable.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-noncallable.js
new file mode 100644
index 0000000000..5b4acc4ca8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-noncallable.js
@@ -0,0 +1,59 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-toprimitive-returns-noncallable.case
+// - src/class-elements/class-evaluation-error/cls-expr.template
+/*---
+description: Custom error evaluating a computed property name (field definitions in a class expression)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class-fields-public, computed-property-names, Symbol.toPrimitive, class]
+flags: [generated]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var obj = {
+ [Symbol.toPrimitive]: {}
+};
+
+
+
+function evaluate() {
+ var C = class {
+ [obj] = refErrorIfEvaluated;
+ };
+}
+
+assert.throws(TypeError
+, evaluate);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-nonobject.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-nonobject.js
new file mode 100644
index 0000000000..7a4c510072
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-toprimitive-returns-nonobject.js
@@ -0,0 +1,58 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-toprimitive-returns-nonobject.case
+// - src/class-elements/class-evaluation-error/cls-expr.template
+/*---
+description: Custom error evaluating a computed property name (field definitions in a class expression)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class-fields-public, computed-property-names, Symbol.toPrimitive, class]
+flags: [generated]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var obj = {
+ [Symbol.toPrimitive]: 42
+};
+
+
+
+function evaluate() {
+ var C = class {
+ [obj] = refErrorIfEvaluated;
+ };
+}
+
+assert.throws(TypeError, evaluate);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-tostring-err.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-tostring-err.js
new file mode 100644
index 0000000000..86e27eee1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-tostring-err.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-tostring-err.case
+// - src/class-elements/class-evaluation-error/cls-expr.template
+/*---
+description: Custom error evaluating a computed property name (field definitions in a class expression)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var obj = {
+ toString: function() {
+ throw new Test262Error();
+ }
+};
+
+
+
+function evaluate() {
+ var C = class {
+ [obj]
+ };
+}
+
+assert.throws(Test262Error
+, evaluate);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-valueof-err.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-valueof-err.js
new file mode 100644
index 0000000000..8bbcab078c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/computed-name-valueof-err.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-name-valueof-err.case
+// - src/class-elements/class-evaluation-error/cls-expr.template
+/*---
+description: Custom error evaluating a computed property name (field definitions in a class expression)
+esid: sec-runtime-semantics-classdefinitionevaluation
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 27. For each ClassElement e in order from elements
+ a. If IsStatic of me is false, then
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false.
+ c. If fields is an abrupt completion, then
+ i. Set the running execution context's LexicalEnvironment to lex.
+ ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment.
+ iii. Return Completion(status).
+ ...
+
+ Runtime Semantics: ClassElementEvaluation
+
+ ClassElement: FieldDefinition;
+ Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object.
+
+ Runtime Semantics: ClassFieldDefinitionEvaluation
+ With parameters isStatic and homeObject.
+
+ 1. Let fieldName be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(fieldName).
+ ...
+
+ Runtime Semantics: Evaluation
+ ComputedPropertyName: [ AssignmentExpression ]
+
+ 1. Let exprValue be the result of evaluating AssignmentExpression.
+ 2. Let propName be ? GetValue(exprValue).
+ 3. Return ? ToPropertyKey(propName).
+
+---*/
+var obj = {
+ toString: undefined,
+ valueOf: function() {
+ throw new Test262Error();
+ }
+};
+
+
+
+function evaluate() {
+ var C = class {
+ [obj]
+ };
+}
+
+assert.throws(Test262Error, evaluate);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/evaluation-error/shell.js b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/evaluation-error/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/field-declaration.js b/js/src/tests/test262/language/expressions/class/elements/field-declaration.js
new file mode 100644
index 0000000000..353ecfd3e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/field-declaration.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/field-declaration.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Fields are defined (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 26. Let instanceFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ i. Let field be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. ...
+ c. ...
+ d. If field is not empty, append field to instanceFields.
+
+ ...
+
+ 30. Set F.[[Fields]] to instanceFields.
+ ...
+
+---*/
+var computed = 'h';
+
+
+var C = class {
+ f = 'test262';
+ 'g';
+ 0 = 'bar';
+ [computed];
+}
+
+let c = new C();
+
+assert.sameValue(C.f, undefined);
+assert.sameValue(C.g, undefined);
+assert.sameValue(C.h, undefined);
+assert.sameValue(C[0], undefined);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C, 'f'),
+ "f does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, 'g'),
+ "g does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, 'h'),
+ "h does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, 0),
+ "0 does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, 'f', {
+ value: 'test262',
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(c, 'g', {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(c, 0, {
+ value: 'bar',
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(c, 'h', {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/field-definition-accessor-no-line-terminator.js b/js/src/tests/test262/language/expressions/class/elements/field-definition-accessor-no-line-terminator.js
new file mode 100644
index 0000000000..0a2bca8caf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/field-definition-accessor-no-line-terminator.js
@@ -0,0 +1,52 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/class-elements/field-definition-accessor-no-line-terminator.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Valid accessor FieldDefinition, ClassElementName, PropertyName Syntax (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [decorators, class]
+flags: [generated]
+info: |
+ FieldDefinition[Yield, Await] :
+ accessor [no LineTerminator here] ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt
+
+---*/
+
+
+var C = class {
+ accessor
+ $;
+ static accessor
+ $;
+
+}
+
+let c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, 'accessor'),
+ "accessor doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, '$'),
+ "$ doesn't appear as an own property on C prototype"
+);
+assert(
+ Object.prototype.hasOwnProperty.call(C, 'accessor'),
+ "C constructor has an own property accessor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, '$'),
+ "$ doesn't appear as an own property on C constructor"
+);
+assert(
+ Object.prototype.hasOwnProperty.call(c, 'accessor'),
+ "C instance has an own property accessor"
+);
+assert(
+ Object.prototype.hasOwnProperty.call(c, '$'),
+ "C instance has an own property $"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-anonymous-function-length.js b/js/src/tests/test262/language/expressions/class/elements/fields-anonymous-function-length.js
new file mode 100644
index 0000000000..f50b3e92bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-anonymous-function-length.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/fields-anonymous-function-length.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Anonymous functions in field initializer have length properly set (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ InitializeInstanceFields ( O, constructor )
+ 1. Assert: Type ( O ) is Object.
+ 2. Assert: constructor is an ECMAScript function object.
+ 3. Let fields be the value of constructor.[[Fields]].
+ 4. For each item fieldRecord in order from fields,
+ a. Perform ? DefineField(O, fieldRecord).
+ 5. Return.
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ ...
+
+---*/
+
+
+var C = class {
+ field = function() {};
+ #field = (a, b, c, d) => undefined;
+
+ accessPrivateField() {
+ return this.#field;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.accessPrivateField().length, 4);
+assert.sameValue(c.field.length, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-1.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-1.js
new file mode 100644
index 0000000000..a49a7dd4a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-1.js
@@ -0,0 +1,21 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- computed name interpreted as property
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public]
+---*/
+
+var obj = {}
+var C = class {
+ x = obj
+ ['lol'] = 42
+}
+
+var c = new C();
+
+assert.sameValue(c.x, 42)
+assert.sameValue(obj['lol'], 42);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-2.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-2.js
new file mode 100644
index 0000000000..2eca4bf63f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-2.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- computed name interpreted as string index
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public]
+---*/
+
+var C = class {
+ x = "lol"
+ [1]
+}
+
+var c = new C();
+
+assert.sameValue(c.x, 'o');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-3.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-3.js
new file mode 100644
index 0000000000..6df7f18af8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-3.js
@@ -0,0 +1,19 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- error when computed name interpreted as index
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = "string"
+ [0]() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-4.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-4.js
new file mode 100644
index 0000000000..92e457a9b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-4.js
@@ -0,0 +1,19 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- error when generator interpreted as multiplication
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public, generators]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = 42
+ *gen() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-5.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-5.js
new file mode 100644
index 0000000000..7a303d07b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-5.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- field with PropertyName "in" interpreted as index
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public]
+---*/
+
+var x = 0;
+var y = 1;
+var z = [42];
+
+var C = class {
+ a = x
+ in
+ z
+ b = y
+ in
+ z
+}
+
+var c = new C();
+
+assert.sameValue(c.a, true, 'a = x in z');
+assert.sameValue(c.b, false, 'b = y in z');
+assert(!Object.prototype.hasOwnProperty.call(c, "in"), "'in' is not parsed as a field declaration");
+assert(!Object.prototype.hasOwnProperty.call(c, "z"), "'z' is not parsed as a field declaration");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-1.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-1.js
new file mode 100644
index 0000000000..1b92ce650f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-1.js
@@ -0,0 +1,18 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2019 Jason Orendorff. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- error when method on same line
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ field /* no ASI here */ method(){}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-2.js b/js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-2.js
new file mode 100644
index 0000000000..5751f38c57
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-asi-same-line-2.js
@@ -0,0 +1,18 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2019 Jason Orendorff. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ASI test in field declarations -- error when method on same line after initializer
+esid: sec-automatic-semicolon-insertion
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ field = 1 /* no ASI here */ method(){}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-computed-name-static-propname-prototype.js b/js/src/tests/test262/language/expressions/class/elements/fields-computed-name-static-propname-prototype.js
new file mode 100644
index 0000000000..3bf563aa25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-computed-name-static-propname-prototype.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-static-fields-public]
+info: |
+ 14.6.13 Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 16. Perform MakeConstructor(F, false, proto).
+ ...
+
+ 9.2.10 MakeConstructor ( F [ , writablePrototype [ , prototype ] ] )
+
+ 6. Perform ! DefinePropertyOrThrow(F, "prototype", PropertyDescriptor { [[Value]]: prototype,
+ [[Writable]]: writablePrototype, [[Enumerable]]: false, [[Configurable]]: false }).
+---*/
+
+var x = "prototype";
+
+assert.throws(TypeError, function() {
+ (0, class {
+ static [x] = 42;
+ });
+});
+
+assert.throws(TypeError, function() {
+ (0, class {
+ static [x];
+ });
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-duplicate-privatenames.js b/js/src/tests/test262/language/expressions/class/elements/fields-duplicate-privatenames.js
new file mode 100644
index 0000000000..feeeb72fe6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-duplicate-privatenames.js
@@ -0,0 +1,25 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Syntax error if the same private field defined twice
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries.
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ #x;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-propname-constructor.js b/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-propname-constructor.js
new file mode 100644
index 0000000000..539bc22fb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-propname-constructor.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: PropName
+ LiteralPropertyName : IdentifierName
+ Return StringValue of IdentifierName.
+
+
+ // This test file tests the following early error:
+ Static Semantics: Early Errors
+
+ ClassElement : FieldDefinition;
+ It is a Syntax Error if PropName of FieldDefinition is "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ constructor;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-constructor.js b/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-constructor.js
new file mode 100644
index 0000000000..4ab66878ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-constructor.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: PropName
+ LiteralPropertyName : IdentifierName
+ Return StringValue of IdentifierName.
+
+
+ // This test file tests the following early error:
+ Static Semantics: Early Errors
+
+ ClassElement : staticFieldDefinition;
+ It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static constructor;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-prototype.js b/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-prototype.js
new file mode 100644
index 0000000000..57b75401b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-literal-name-static-propname-prototype.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: PropName
+ LiteralPropertyName : IdentifierName
+ Return StringValue of IdentifierName.
+
+
+ // This test file tests the following early error:
+ Static Semantics: Early Errors
+
+ ClassElement : staticFieldDefinition;
+ It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static prototype;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-multiple-definitions-static-private-methods-proxy.js b/js/src/tests/test262/language/expressions/class/elements/fields-multiple-definitions-static-private-methods-proxy.js
new file mode 100644
index 0000000000..18d278fc27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-multiple-definitions-static-private-methods-proxy.js
@@ -0,0 +1,41 @@
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Static private methods not accessible via default Proxy handler
+esid: prod-FieldDefinition
+features: [class, class-static-methods-private]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x(value) {
+ return 1;
+ }
+ static x() {
+ return this.#x();
+ }
+}
+
+var P = new Proxy(C, {});
+
+assert.sameValue(C.x(), 1);
+assert.throws(TypeError, function() {
+ P.x();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-run-once-on-double-super.js b/js/src/tests/test262/language/expressions/class/elements/fields-run-once-on-double-super.js
new file mode 100644
index 0000000000..5121028216
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-run-once-on-double-super.js
@@ -0,0 +1,43 @@
+// Copyright (C) 2018 Kevin Gibbons. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-super-keyword-runtime-semantics-evaluation
+description: >
+ when calling `super()` for a second time in a derived class, the super constructor is run twice but the field initializers are only run once
+info: |
+ [...]
+ 6. Let result be ? Construct(func, argList, newTarget).
+ [...]
+ 10. Perform ? thisER.BindThisValue(result).
+ 11. Perform ? InitializeInstanceFields(result, F).
+ [...]
+features: [class-fields-public]
+---*/
+
+
+var baseCtorCalled = 0;
+var fieldInitCalled = 0;
+class Base {
+ constructor() {
+ ++baseCtorCalled;
+ }
+}
+
+var C = class extends Base {
+ field = ++fieldInitCalled;
+ constructor() {
+ assert.sameValue(baseCtorCalled, 0);
+ assert.sameValue(fieldInitCalled, 0);
+ super();
+ assert.sameValue(baseCtorCalled, 1);
+ assert.sameValue(fieldInitCalled, 1);
+ assert.throws(ReferenceError, () => super());
+ }
+};
+
+new C();
+
+assert.sameValue(baseCtorCalled, 2);
+assert.sameValue(fieldInitCalled, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-string-name-propname-constructor.js b/js/src/tests/test262/language/expressions/class/elements/fields-string-name-propname-constructor.js
new file mode 100644
index 0000000000..78b22eb338
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-string-name-propname-constructor.js
@@ -0,0 +1,31 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: PropName
+ ...
+ LiteralPropertyName : StringLiteral
+ Return the String value whose code units are the SV of the StringLiteral.
+
+
+ // This test file tests the following early error:
+ Static Semantics: Early Errors
+
+ ClassElement : FieldDefinition;
+ It is a Syntax Error if PropName of FieldDefinition is "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ 'constructor';
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-constructor.js b/js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-constructor.js
new file mode 100644
index 0000000000..8971ec32ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-constructor.js
@@ -0,0 +1,31 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: PropName
+ ...
+ LiteralPropertyName : StringLiteral
+ Return the String value whose code units are the SV of the StringLiteral.
+
+
+ // This test file tests the following early error:
+ Static Semantics: Early Errors
+
+ ClassElement : staticFieldDefinition;
+ It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static 'constructor';
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-prototype.js b/js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-prototype.js
new file mode 100644
index 0000000000..9bcff628d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/fields-string-name-static-propname-prototype.js
@@ -0,0 +1,31 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: PropName
+ ...
+ LiteralPropertyName : StringLiteral
+ Return the String value whose code units are the SV of the StringLiteral.
+
+
+ // This test file tests the following early error:
+ Static Semantics: Early Errors
+
+ ClassElement : staticFieldDefinition;
+ It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static 'prototype';
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/browser.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/shell.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..7f6c8c2615
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier-escaped.case
+// - src/generators/syntax/class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *#gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..85e1357cd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-binding-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier.case
+// - src/generators/syntax/class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *#gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..202f78ca91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference-escaped.case
+// - src/generators/syntax/class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *#gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..1eb4326859
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-identifier-reference.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference.case
+// - src/generators/syntax/class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *#gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..af8f86a3bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier-escaped.case
+// - src/generators/syntax/class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *#gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier.js
new file mode 100644
index 0000000000..5bd7f5a197
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-as-label-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier.case
+// - src/generators/syntax/class-expr-static-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *#gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..ec6678dabd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,75 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-spread-strict.case
+// - src/generators/default/class-expr-static-private-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [object-spread, generators, class-static-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class {
+ static *#gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..2d8409f00c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-identifier-strict-strict.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-strict.case
+// - src/generators/default/class-expr-static-private-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [generators, class-static-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class {
+ static *#gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..f1c1cccfff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-multiple.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-multiple.case
+// - src/generators/default/class-expr-static-private-method.template
+/*---
+description: Use yield value in a array spread position (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+var callCount = 0;
+
+var C = class {
+ static *#gen() {
+ callCount += 1;
+ yield [...yield yield];
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+item = iter.next(item.value);
+
+assert.compareArray(item.value, arr);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-single.js
new file mode 100644
index 0000000000..6e825fe591
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-arr-single.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-single.case
+// - src/generators/default/class-expr-static-private-method.template
+/*---
+description: Use yield value in a array spread position (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [generators, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+---*/
+var arr = ['a', 'b', 'c'];
+
+var callCount = 0;
+
+var C = class {
+ static *#gen() {
+ callCount += 1;
+ yield [...yield];
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next(false);
+var item = iter.next(arr);
+var value = item.value;
+
+assert.notSameValue(value, arr, 'value is a new array');
+assert(Array.isArray(value), 'value is an Array exotic object');
+assert.sameValue(value.length, 3)
+assert.sameValue(value[0], 'a');
+assert.sameValue(value[1], 'b');
+assert.sameValue(value[2], 'c');
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-obj.js
new file mode 100644
index 0000000000..2a8d38a296
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method-static/yield-spread-obj.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-obj.case
+// - src/generators/default/class-expr-static-private-method.template
+/*---
+description: Use yield value in a object spread position (Static generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [object-spread, generators, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ static PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+var callCount = 0;
+
+var C = class {
+ static *#gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+ }
+ static get gen() { return this.#gen; }
+}
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+var iter = C.gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+assert.sameValue(item.value.x, 42);
+assert.sameValue(item.value.y, 39);
+assert.sameValue(Object.keys(item.value).length, 2);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/browser.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/shell.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..e7722c5e35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier-escaped.case
+// - src/generators/syntax/class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*#gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..4b017c8e82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-binding-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier.case
+// - src/generators/syntax/class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*#gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..6a6bf24503
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference-escaped.case
+// - src/generators/syntax/class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*#gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..753e0a585f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-identifier-reference.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference.case
+// - src/generators/syntax/class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*#gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..fc1d2dfda4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier-escaped.case
+// - src/generators/syntax/class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*#gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier.js
new file mode 100644
index 0000000000..d2830d4476
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-as-label-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier.case
+// - src/generators/syntax/class-expr-private-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators, class-methods-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*#gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..8ce31ff8f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-spread-strict.case
+// - src/generators/default/class-expr-private-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [object-spread, generators, class-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class {
+ *#gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..6710c4b1a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-identifier-strict-strict.js
@@ -0,0 +1,76 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-strict.case
+// - src/generators/default/class-expr-private-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [generators, class-methods-private]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class {
+ *#gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..21bf163956
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-multiple.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-multiple.case
+// - src/generators/default/class-expr-private-method.template
+/*---
+description: Use yield value in a array spread position (Generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [generators, class-methods-private]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+var callCount = 0;
+
+var C = class {
+ *#gen() {
+ callCount += 1;
+ yield [...yield yield];
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+item = iter.next(item.value);
+
+assert.compareArray(item.value, arr);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-single.js
new file mode 100644
index 0000000000..e17af9fbec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-arr-single.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-single.case
+// - src/generators/default/class-expr-private-method.template
+/*---
+description: Use yield value in a array spread position (Generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [generators, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+---*/
+var arr = ['a', 'b', 'c'];
+
+var callCount = 0;
+
+var C = class {
+ *#gen() {
+ callCount += 1;
+ yield [...yield];
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next(false);
+var item = iter.next(arr);
+var value = item.value;
+
+assert.notSameValue(value, arr, 'value is a new array');
+assert(Array.isArray(value), 'value is an Array exotic object');
+assert.sameValue(value.length, 3)
+assert.sameValue(value[0], 'a');
+assert.sameValue(value[1], 'b');
+assert.sameValue(value[2], 'c');
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-obj.js
new file mode 100644
index 0000000000..59f54a8897
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/gen-private-method/yield-spread-obj.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-obj.case
+// - src/generators/default/class-expr-private-method.template
+/*---
+description: Use yield value in a object spread position (Generator private method as a ClassExpression element)
+esid: prod-GeneratorPrivateMethod
+features: [object-spread, generators, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ PrivateMethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+var callCount = 0;
+
+var C = class {
+ *#gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+ }
+ get gen() { return this.#gen; }
+}
+
+const c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+var iter = c.gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+assert.sameValue(item.value.x, 42);
+assert.sameValue(item.value.y, 39);
+assert.sameValue(Object.keys(item.value).length, 2);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+// Test the private fields do not appear as properties after set to value
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "#gen"),
+ "Private field '#gen' does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "#gen"),
+ "Private field '#gen' does not appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "#gen"),
+ "Private field '#gen' does not appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/grammar-private-field-optional-chaining.js b/js/src/tests/test262/language/expressions/class/elements/grammar-private-field-optional-chaining.js
new file mode 100644
index 0000000000..39caf89b6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/grammar-private-field-optional-chaining.js
@@ -0,0 +1,42 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-field-optional-chaining.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName after '?.' is valid syntax (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, optional-chaining, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ OptionalChain[Yield, Await]:
+ `?.` `[` Expression[+In, ?Yield, ?Await] `]`
+ `?.` IdentifierName
+ `?.` Arguments[?Yield, ?Await]
+ `?.` TemplateLiteral[?Yield, ?Await, +Tagged]
+ `?.` PrivateIdentifier
+
+---*/
+
+
+var C = class {
+ #m = 'test262';
+
+ static access(obj) {
+ return obj?.#m;
+ }
+}
+
+let c = new C();
+
+assert.sameValue(C.access(c), 'test262');
+
+assert.sameValue(C.access(null), undefined);
+assert.sameValue(C.access(undefined), undefined);
+
+assert.throws(TypeError, function() {
+ C.access({});
+}, 'accessed private field from an ordinary object');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/indirect-eval-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/indirect-eval-contains-arguments.js
new file mode 100644
index 0000000000..575b98ffd5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/indirect-eval-contains-arguments.js
@@ -0,0 +1,24 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-arguments.case
+// - src/class-elements/initializer-indirect-eval-arguments/cls-expr-fields-indirect-eval.template
+/*---
+description: No error if `arguments` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated, noStrict]
+info: |
+ For indirect eval, the "Additional Early Error Rules for Eval Inside Initializer"
+ (in #sec-performeval-rules-in-initializer) are NOT applicable.
+
+---*/
+
+
+var arguments = 1;
+var executed = false;
+var C = class {
+ x = (0, eval)('arguments;');
+}
+
+assert.sameValue(new C().x, arguments);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/indirect-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/indirect-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..2844b4a997
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/indirect-eval-err-contains-newtarget.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-indirect-eval.template
+/*---
+description: error if `new.target` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ x = (0, eval)('executed = true; new.target;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/init-err-evaluation.js b/js/src/tests/test262/language/expressions/class/elements/init-err-evaluation.js
new file mode 100644
index 0000000000..ec68dde36c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/init-err-evaluation.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-evaluation.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Return abrupt completion evaluating the field initializer (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ [[Construct]] ( argumentsList, newTarget)
+
+ 8. If kind is "base", then
+ a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ ...
+ ...
+ 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ ...
+
+---*/
+var x = 0;
+function fn1() { x += 1; }
+function fn2() { throw new Test262Error(); }
+
+
+var C = class {
+ x = fn1();
+ y = fn2();
+ z = fn1();
+}
+
+assert.throws(Test262Error, function() {
+ new C();
+});
+
+assert.sameValue(x, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/init-value-defined-after-class.js b/js/src/tests/test262/language/expressions/class/elements/init-value-defined-after-class.js
new file mode 100644
index 0000000000..60bced7c00
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/init-value-defined-after-class.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-value-defined-after-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: The initializer value is defined after the class evaluation (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ [[Construct]] ( argumentsList, newTarget)
+
+ 8. If kind is "base", then
+ a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ ...
+ ...
+ 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ ...
+
+---*/
+var x = false;
+
+
+var C = class {
+ [x] = x;
+}
+
+var c1 = new C();
+
+x = true;
+var c2 = new C();
+
+verifyProperty(c1, "false", {
+ value: false,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+verifyProperty(c2, "false", {
+ value: true,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c1.hasOwnProperty("true"), false);
+assert.sameValue(c2.hasOwnProperty("true"), false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/init-value-incremental.js b/js/src/tests/test262/language/expressions/class/elements/init-value-incremental.js
new file mode 100644
index 0000000000..c9a6a17f84
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/init-value-incremental.js
@@ -0,0 +1,70 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-value-incremental.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: The initializer value is defined during the class instatiation (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ 27. For each ClassElement e in order from elements
+ ...
+ d. Append to fieldRecords the elements of fields.
+ ...
+ 33. Let result be InitializeStaticFields(F).
+ ...
+
+ [[Construct]] ( argumentsList, newTarget)
+
+ 8. If kind is "base", then
+ a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ ...
+ ...
+ 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ ...
+
+---*/
+var x = 1;
+
+
+var C = class {
+ [x++] = x++;
+ [x++] = x++;
+}
+
+var c1 = new C();
+var c2 = new C();
+
+verifyProperty(c1, "1", {
+ value: 3,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+verifyProperty(c1, "2", {
+ value: 4,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+verifyProperty(c2, "1", {
+ value: 5,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+verifyProperty(c2, "2", {
+ value: 6,
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/intercalated-static-non-static-computed-fields.js b/js/src/tests/test262/language/expressions/class/elements/intercalated-static-non-static-computed-fields.js
new file mode 100644
index 0000000000..4eda07a71a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/intercalated-static-non-static-computed-fields.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/intercalated-static-non-static-computed-fields.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Computed class fields are executed in the order they are delcared, regardless it is static or instance field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ i. Let field be the result of performing ClassElementEvaluation for e with arguments proto and false.
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for mClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+ ...
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ [[Construct]] (argumentsList, newTarget)
+ ...
+ 8. If kind is "base", then
+ a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ c. If result is an abrupt completion, then
+ i. Remove calleeContext from execution context stack and restore callerContext as the running execution context.
+ ii. Return Completion(result).
+
+---*/
+
+let i = 0;
+
+
+var C = class {
+ [i++] = i++;
+ static [i++] = i++;
+ [i++] = i++;
+}
+
+let c = new C();
+
+// It is important to notice that static field initializer will run before any instance initializer
+verifyProperty(c, "0", {
+ value: 4,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(c, "2", {
+ value: 5,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(C, "1", {
+ value: 3,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert.sameValue(i, 6);
+assert.sameValue(c.hasOwnProperty('1'), false);
+assert.sameValue(C.hasOwnProperty('0'), false);
+assert.sameValue(C.hasOwnProperty('2'), false);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..93be9a1b6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-literal-name.template
+/*---
+description: Syntax error if `arguments` used in class field (literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..f80644bbf4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/literal-name-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-literal-name.template
+/*---
+description: Syntax error if `super()` used in class field (literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-names.js
new file mode 100644
index 0000000000..7413b570de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-names.js
@@ -0,0 +1,158 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Computed property names (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ [x] = 42; [10] = "meep"; ["not initialized"]
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-symbol-names.js
new file mode 100644
index 0000000000..dae61893bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-computed-symbol-names.js
@@ -0,0 +1,156 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Computed property symbol names (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ [x]; [y] = 42
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..af98fc0a2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,160 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: PrivateName Static Semantics, StringValue (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;
+ m2() { return 39 }
+ bar = "barbaz";
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names-asi.js
new file mode 100644
index 0000000000..163528eb18
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names-asi.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Literal property names with ASI (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ a
+ b = 42;
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names.js
new file mode 100644
index 0000000000..a21e07cf69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-literal-names.js
@@ -0,0 +1,147 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Literal property names (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ a; b = 42;
+ c = fn
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-field-usage.js
new file mode 100644
index 0000000000..4b0f6cd6d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-field-usage.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: PrivateName CallExpression usage (private field) (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #m = 'test262';
+ m2() { return 39 }
+ bar = "barbaz";
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-getter-usage.js
new file mode 100644
index 0000000000..0a6f0094c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-getter-usage.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ get #m() { return 'test262'; }
+ m2() { return 39 }
+ bar = "barbaz";
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-usage.js
new file mode 100644
index 0000000000..8135fb64c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-method-usage.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: PrivateName CallExpression usage (private method) (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #m() { return 'test262'; }
+ m2() { return 39 }
+ bar = "barbaz";
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-names.js
new file mode 100644
index 0000000000..0c0d8a64e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-private-names.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: private names (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #x; #y
+ m2() { return 39 }
+ bar = "barbaz";
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..83bb905415
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier-initializer.js
@@ -0,0 +1,138 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid FieldDefinition (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier.js
new file mode 100644
index 0000000000..7d291aff0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-field-identifier.js
@@ -0,0 +1,145 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid FieldDefinition (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter-alt.js
new file mode 100644
index 0000000000..935cb7b4d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter-alt.js
@@ -0,0 +1,179 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName as private getter (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter.js
new file mode 100644
index 0000000000..5265e916ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-getter.js
@@ -0,0 +1,179 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName as private getter (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method-alt.js
new file mode 100644
index 0000000000..782636708b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method-alt.js
@@ -0,0 +1,178 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName as private method (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method.js
new file mode 100644
index 0000000000..41cf968b92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-method.js
@@ -0,0 +1,178 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName as private method (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter-alt.js
new file mode 100644
index 0000000000..09405d44d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter-alt.js
@@ -0,0 +1,178 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName as private setter (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter.js
new file mode 100644
index 0000000000..9fa4224113
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-private-setter.js
@@ -0,0 +1,178 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName as private setter (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..5207b6f797
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-alt.js
@@ -0,0 +1,160 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..e072a1a26c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,154 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1
+ m2() { return 39 }
+ bar = "barbaz";
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..0b120e9f24
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier-initializer.js
@@ -0,0 +1,154 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1
+ m2() { return 39 }
+ bar = "barbaz";
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier.js
new file mode 100644
index 0000000000..6871e1b258
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-privatename-identifier.js
@@ -0,0 +1,160 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J
+ m2() { return 39 }
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..6a66c94792
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,185 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..2a73d2410b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,186 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..caa904840d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,185 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static AsyncMethod PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..6ee9b3fcbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,186 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static AsyncMethod PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..aab7ce8cd1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,175 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..c64a50a2a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,176 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..e38d8c9be2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,173 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static Method PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..9d9a58356f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-method-privatename-identifier.js
@@ -0,0 +1,173 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static Method PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ }
+ m2() { return 39 }
+ bar = "barbaz";
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..09a8b75236
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,161 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ m2() { return 39 }
+ bar = "barbaz";
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..f6feaed2d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,161 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ m2() { return 39 }
+ bar = "barbaz";
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..1a73f619f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,161 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ m2() { return 39 }
+ bar = "barbaz";
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..bd4f31926f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,155 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ m2() { return 39 }
+ bar = "barbaz";
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..9a072fe1a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,155 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ m2() { return 39 }
+ bar = "barbaz";
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..6e921a5499
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,155 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1
+ m2() { return 39 }
+ bar = "barbaz";
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..3fb7b0a0b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-rs-static-privatename-identifier.js
@@ -0,0 +1,161 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: Valid Static PrivateName (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ m2() { return 39 }
+ bar = "barbaz";
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-fields.js
new file mode 100644
index 0000000000..66675da1ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-fields.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: static private fields (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #x; static #y
+ m2() { return 39 }
+ bar = "barbaz";
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..673d8d961c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods-with-fields.js
@@ -0,0 +1,139 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: static private methods with fields (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ static #xVal; static #yVal
+ m2() { return 39 }
+ bar = "barbaz";
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods.js
new file mode 100644
index 0000000000..ebff71e556
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-static-private-methods.js
@@ -0,0 +1,126 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: static private methods (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+
+ m2() { return 39 }
+ bar = "barbaz";
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-string-literal-names.js
new file mode 100644
index 0000000000..136006fb46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-definitions-string-literal-names.js
@@ -0,0 +1,160 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-multiple-definitions.template
+/*---
+description: String literal names (multiple fields definitions)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ foo = "foobar";
+ m() { return 42 }
+ 'a'; "b"; 'c' = 39;
+ "d" = 42
+ m2() { return 39 }
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.m2(), 39);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m2"),
+ "m2 doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m2, C.prototype.m2);
+
+verifyProperty(C.prototype, "m2", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-names.js
new file mode 100644
index 0000000000..ff67889a12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-names.js
@@ -0,0 +1,130 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Computed property names (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"]
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-symbol-names.js
new file mode 100644
index 0000000000..919e9f5311
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-computed-symbol-names.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Computed property symbol names (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..c82dd4e75a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,132 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: PrivateName Static Semantics, StringValue (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;
+ foo = "foobar"
+ bar = "barbaz";
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names-asi.js
new file mode 100644
index 0000000000..90629749a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names-asi.js
@@ -0,0 +1,100 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Literal property names with ASI (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names.js
new file mode 100644
index 0000000000..e547fa0cbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-literal-names.js
@@ -0,0 +1,119 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Literal property names (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-field-usage.js
new file mode 100644
index 0000000000..37e31119ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-field-usage.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: PrivateName CallExpression usage (private field) (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';
+ foo = "foobar"
+ bar = "barbaz";
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-getter-usage.js
new file mode 100644
index 0000000000..83d0560f34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-getter-usage.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; }
+ foo = "foobar"
+ bar = "barbaz";
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-usage.js
new file mode 100644
index 0000000000..b15e81b489
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-method-usage.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: PrivateName CallExpression usage (private method) (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }
+ foo = "foobar"
+ bar = "barbaz";
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-names.js
new file mode 100644
index 0000000000..ba4179c322
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-private-names.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: private names (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y
+ foo = "foobar"
+ bar = "barbaz";
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..51cc93ee63
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier-initializer.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid FieldDefinition (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier.js
new file mode 100644
index 0000000000..22efdd1a8b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-field-identifier.js
@@ -0,0 +1,117 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid FieldDefinition (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter-alt.js
new file mode 100644
index 0000000000..b3d9fd1965
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter-alt.js
@@ -0,0 +1,151 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName as private getter (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter.js
new file mode 100644
index 0000000000..980a6582be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-getter.js
@@ -0,0 +1,151 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName as private getter (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method-alt.js
new file mode 100644
index 0000000000..24d63755c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method-alt.js
@@ -0,0 +1,150 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName as private method (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method.js
new file mode 100644
index 0000000000..2a82c3c604
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-method.js
@@ -0,0 +1,150 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName as private method (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter-alt.js
new file mode 100644
index 0000000000..5a89c99322
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter-alt.js
@@ -0,0 +1,150 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName as private setter (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter.js
new file mode 100644
index 0000000000..dddc936a56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-private-setter.js
@@ -0,0 +1,150 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName as private setter (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..1d7ce81f5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-alt.js
@@ -0,0 +1,132 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..da4242fb3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,126 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1
+ foo = "foobar"
+ bar = "barbaz";
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..b54716d4c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier-initializer.js
@@ -0,0 +1,126 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1
+ foo = "foobar"
+ bar = "barbaz";
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier.js
new file mode 100644
index 0000000000..709c94dcae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-privatename-identifier.js
@@ -0,0 +1,132 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J
+ foo = "foobar"
+ bar = "barbaz";
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..5be482d5f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,157 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..319757b4c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,158 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..18a0aad6cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,157 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static AsyncMethod PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..48bcf6fbf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,158 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static AsyncMethod PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..fe9c7b8737
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,147 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..7882f8947a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,148 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..8699ddc874
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,145 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..57e272c9c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-method-privatename-identifier.js
@@ -0,0 +1,145 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ }
+ foo = "foobar"
+ bar = "barbaz";
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..a213b509f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,133 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ foo = "foobar"
+ bar = "barbaz";
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..687db46d38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,133 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ foo = "foobar"
+ bar = "barbaz";
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..afa4761ddb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,133 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ foo = "foobar"
+ bar = "barbaz";
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..ff0a82c30c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ foo = "foobar"
+ bar = "barbaz";
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..596e888946
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ foo = "foobar"
+ bar = "barbaz";
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..af365f5ee5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1
+ foo = "foobar"
+ bar = "barbaz";
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..ff78487511
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-rs-static-privatename-identifier.js
@@ -0,0 +1,133 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: Valid Static PrivateName (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ foo = "foobar"
+ bar = "barbaz";
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-fields.js
new file mode 100644
index 0000000000..f0d506bbfc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-fields.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: static private fields (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y
+ foo = "foobar"
+ bar = "barbaz";
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..5e242d72d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods-with-fields.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: static private methods with fields (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal
+ foo = "foobar"
+ bar = "barbaz";
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods.js
new file mode 100644
index 0000000000..330f1d9a59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-static-private-methods.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: static private methods (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+
+ foo = "foobar"
+ bar = "barbaz";
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-string-literal-names.js
new file mode 100644
index 0000000000..3a33c9aad7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/multiple-stacked-definitions-string-literal-names.js
@@ -0,0 +1,132 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-multiple-stacked-definitions.template
+/*---
+description: String literal names (multiple stacked fields definitions through ASI)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42
+ foo = "foobar"
+ bar = "barbaz";
+
+}
+
+var c = new C();
+
+assert.sameValue(c.foo, "foobar");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "foo"),
+ "foo doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
+ "foo doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "foo", {
+ value: "foobar",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.bar, "barbaz");
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "bar"),
+ "bar doesn't appear as an own property on the C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
+ "bar doesn't appear as an own property on the C prototype"
+);
+
+verifyProperty(c, "bar", {
+ value: "barbaz",
+ enumerable: true,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-arguments.js
new file mode 100644
index 0000000000..6d88dd8a55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-arguments.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-arrow-fnc-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => {
+ var t = () => arguments;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-super.js
new file mode 100644
index 0000000000..8029180d3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-arrow-fnc-init-err-contains-super.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-arrow-fnc-nested.template
+/*---
+description: Syntax error if `super()` used in class field (arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => {
+ var t = () => super();
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..67b7fa87dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-comp-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ [x] = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-super.js
new file mode 100644
index 0000000000..f5363a56bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-comp-name-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-comp-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ [x] = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..faf9d55d95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-nested.template
+/*---
+description: super.x in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super.x;');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..c470bcaad9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-nested.template
+/*---
+description: super['x'] in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super["x"];');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..4083514977
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-nested.template
+/*---
+description: error if `super()['x']` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..d151738def
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-nested.template
+/*---
+description: error if `super().x` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..f6c0ac7be6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-direct-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-nested.template
+/*---
+description: error if `super()` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = eval('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..c9bcc42789
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: super.x in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super.x;');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..808bf4e4f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-contains-superproperty-2.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: super['x'] in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super["x"];');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..21da0e7766
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: error if `super()['x']` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..4c93e29fae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: error if `super().x` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..c567ff5c21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-derived-cls-indirect-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: error if `super()` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ x = (0, eval)('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-arguments.js
new file mode 100644
index 0000000000..40f88d6d9a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-arguments.js
@@ -0,0 +1,41 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-arguments.case
+// - src/class-elements/initializer-direct-eval-arguments/cls-expr-fields-eval-nested.template
+/*---
+description: error if `arguments` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if ContainsArguments of StatementList is true.
+ ...
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+let executed = false;
+let C = class {
+ x = () => {
+ let f = eval('executed = true; arguments;');
+ f();
+ }
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..d0ebf9bb92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-direct-eval-err-contains-newtarget.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-eval-nested.template
+/*---
+description: error if `new.target` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ x = eval('executed = true; new.target;');
+}
+
+var c = new C();
+
+assert.sameValue(executed, true);
+assert.sameValue(c.x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-arguments.js
new file mode 100644
index 0000000000..440c94c8a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-equality-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (equality expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => {} == arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-super.js
new file mode 100644
index 0000000000..fad1183367
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-equality-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-equality-nested.template
+/*---
+description: Syntax error if `super()` used in class field (equality expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => {} == super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-contains-arguments.js
new file mode 100644
index 0000000000..037585ce47
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-contains-arguments.js
@@ -0,0 +1,23 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-arguments.case
+// - src/class-elements/initializer-indirect-eval-arguments/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: No error if `arguments` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public]
+flags: [generated, noStrict]
+info: |
+ For indirect eval, the "Additional Early Error Rules for Eval Inside Initializer"
+ (in #sec-performeval-rules-in-initializer) are NOT applicable.
+
+---*/
+
+
+var arguments = 1;
+var C = class {
+ x = () => (0, eval)('arguments;');
+}
+
+assert.sameValue(new C().x(), arguments);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..4524e19275
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-indirect-eval-err-contains-newtarget.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-indirect-eval-nested.template
+/*---
+description: error if `new.target` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-public]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ x = (0, eval)('executed = true; new.target;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..9d414b0dcd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-literal-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..fffa55a81c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-literal-name-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-literal-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-arguments.js
new file mode 100644
index 0000000000..8bb51845c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-arguments.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-arrow-fnc-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (private field, arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => {
+ var t = () => arguments;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-super.js
new file mode 100644
index 0000000000..56c9fe70fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-arrow-fnc-init-err-contains-super.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-arrow-fnc-nested.template
+/*---
+description: Syntax error if `super()` used in class field (private field, arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => {
+ var t = () => super();
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..be5c4ada89
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-nested.template
+/*---
+description: super.x in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super.x;');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..1e95968ade
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-nested.template
+/*---
+description: super['x'] in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super["x"];');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..8fdfdfe461
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-nested.template
+/*---
+description: error if `super()['x']` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..e109000e49
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-nested.template
+/*---
+description: error if `super().x` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..ecbd9df6d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-direct-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-nested.template
+/*---
+description: error if `super()` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..d9380a5032
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: super.x in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super.x;');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..838cfa34dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-contains-superproperty-2.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: super['x'] in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super["x"];');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..7aa613b4be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: error if `super()['x']` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..faeaaa9216
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: error if `super().x` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..dad896c8f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-derived-cls-indirect-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: error if `super()` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-arguments.js
new file mode 100644
index 0000000000..d2d5a4228c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-arguments.js
@@ -0,0 +1,41 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-arguments.case
+// - src/class-elements/initializer-direct-eval-arguments/cls-expr-private-fields-eval-nested.template
+/*---
+description: error if `arguments` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if ContainsArguments of StatementList is true.
+ ...
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = () => eval('executed = true; arguments;');
+ x() {
+ this.#x();
+ }
+}
+
+assert.throws(SyntaxError, function() {
+ new C().x();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..c7585ff30b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-direct-eval-err-contains-newtarget.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-eval-nested.template
+/*---
+description: error if `new.target` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = eval('executed = true; new.target;');
+}
+
+var c = new C();
+
+assert.sameValue(executed, true);
+assert.sameValue(c.x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-contains-arguments.js
new file mode 100644
index 0000000000..a632ad3d3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-contains-arguments.js
@@ -0,0 +1,26 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-arguments.case
+// - src/class-elements/initializer-indirect-eval-arguments/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: No error if `arguments` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated, noStrict]
+info: |
+ For indirect eval, the "Additional Early Error Rules for Eval Inside Initializer"
+ (in #sec-performeval-rules-in-initializer) are NOT applicable.
+
+---*/
+
+
+var arguments = 1;
+var C = class {
+ #x = () => (0, eval)('arguments;');
+ x() {
+ return this.#x();
+ }
+}
+
+assert.sameValue(new C().x(), arguments);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..b3a916948a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-indirect-eval-err-contains-newtarget.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval-nested.template
+/*---
+description: error if `new.target` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = (0, eval)('executed = true; new.target;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..17ff2b7c0d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (ClassElementName PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..170fd74e97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-literal-name-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (ClassElementName PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-arguments.js
new file mode 100644
index 0000000000..d678a87c8a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-ternary-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (private field, ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => true ? {} : arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-super.js
new file mode 100644
index 0000000000..3c241eaf8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-ternary-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-ternary-nested.template
+/*---
+description: Syntax error if `super()` used in class field (private field, ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => true ? {} : super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-arguments.js
new file mode 100644
index 0000000000..e96ddac107
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-typeof-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (private field, typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => typeof arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-super.js
new file mode 100644
index 0000000000..a4fbb1ab8f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-private-typeof-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-typeof-nested.template
+/*---
+description: Syntax error if `super()` used in class field (private field, typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => typeof super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..2fb25520bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-comp-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (static computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public, computed-property-names]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ static [x] = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-super.js
new file mode 100644
index 0000000000..9c155d9dd4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-comp-name-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-comp-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (static computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public, computed-property-names]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ static [x] = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-arguments.js
new file mode 100644
index 0000000000..bea5192253
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-literal-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (static literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ static x = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-super.js
new file mode 100644
index 0000000000..28511188e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-literal-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-literal-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (static literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ static x = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-arguments.js
new file mode 100644
index 0000000000..77389eae68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-private-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (static PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #x = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-super.js
new file mode 100644
index 0000000000..2c9c71d224
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-private-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-private-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (static PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #x = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..48e23c129e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-string-literal-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (static string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ static 'x' = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..ec8c7419e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-static-string-literal-name-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-string-literal-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (static string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ static 'x' = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..ed95c89fc9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-string-literal-name-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ 'x' = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..421942f700
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-string-literal-name-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-string-literal-name-nested.template
+/*---
+description: Syntax error if `super()` used in class field (string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ 'x' = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-arguments.js
new file mode 100644
index 0000000000..4f88d747d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-ternary-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => true ? {} : arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-super.js
new file mode 100644
index 0000000000..cf7764091f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-ternary-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-ternary-nested.template
+/*---
+description: Syntax error if `super()` used in class field (ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => true ? {} : super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-arguments.js
new file mode 100644
index 0000000000..3bc14c08c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-arguments.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-typeof-nested.template
+/*---
+description: Syntax error if `arguments` used in class field (typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => typeof arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-super.js
new file mode 100644
index 0000000000..fb8c7b25ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/nested-typeof-init-err-contains-super.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-typeof-nested.template
+/*---
+description: Syntax error if `super()` used in class field (typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = () => typeof super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-names.js
new file mode 100644
index 0000000000..0c0858df09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-names.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Computed property names (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"]
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-symbol-names.js
new file mode 100644
index 0000000000..bbdfac0133
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-computed-symbol-names.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Computed property symbol names (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..f27760cd12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;
+ m() { return 42; }
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names-asi.js
new file mode 100644
index 0000000000..5532125eb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names-asi.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names.js
new file mode 100644
index 0000000000..c384eab0e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-literal-names.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Literal property names (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-field-usage.js
new file mode 100644
index 0000000000..0546b4b429
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-field-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';
+ m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..9d8ec9da19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-getter-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; }
+ m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-usage.js
new file mode 100644
index 0000000000..bb6512df0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-method-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }
+ m() { return 42; }
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-names.js
new file mode 100644
index 0000000000..e4d0cc438f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-private-names.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: private names (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y
+ m() { return 42; }
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..c780598caf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier-initializer.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier.js
new file mode 100644
index 0000000000..6d647d5586
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-field-identifier.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..916834b5b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter-alt.js
@@ -0,0 +1,129 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter.js
new file mode 100644
index 0000000000..e43fe25fef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-getter.js
@@ -0,0 +1,129 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..44acf6d965
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method.js
new file mode 100644
index 0000000000..1d05fbc5b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-method.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..0dbf55cfe9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter.js
new file mode 100644
index 0000000000..859d97fc55
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-private-setter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..6d1c508cc5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..08ff109053
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1
+ m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..bb2f00d98d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1
+ m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..ec70f8d0a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..d676216aa4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ }
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..52414c43f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ }
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..107ad5045e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ }
+ m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..8d6571ce75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ }
+ m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..9707dc7428
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ }
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..71be8f2e14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,126 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ }
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..0405f50d1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ }
+ m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..accc941e25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ }
+ m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..8868bc7b49
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..023b9986f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..a090a6cf1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..99ba09403a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ m() { return 42; }
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..9234dbf6c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..04a7973169
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1
+ m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..908f0967e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-rs-static-privatename-identifier.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-fields.js
new file mode 100644
index 0000000000..6f4a03a50c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-fields.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: static private fields (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y
+ m() { return 42; }
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..df6b5b94c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods-with-fields.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: static private methods with fields (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal
+ m() { return 42; }
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods.js
new file mode 100644
index 0000000000..8370e6fd30
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-static-private-methods.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: static private methods (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+
+ m() { return 42; }
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-string-literal-names.js
new file mode 100644
index 0000000000..a265be2d09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-no-sc-line-method-string-literal-names.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-new-no-sc-line-method.template
+/*---
+description: String literal names (field definitions followed by a method in a new line without a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-names.js
new file mode 100644
index 0000000000..85b8f14f9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-names.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Computed property names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"];
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-symbol-names.js
new file mode 100644
index 0000000000..a40222a4f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-computed-symbol-names.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42;
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..c8cb012fbb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ *m() { return 42; }
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names-asi.js
new file mode 100644
index 0000000000..40555ed1c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names-asi.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;;
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names.js
new file mode 100644
index 0000000000..512b61e0c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-literal-names.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Literal property names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn;
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-field-usage.js
new file mode 100644
index 0000000000..d24e703794
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-field-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';;
+ *m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-getter-usage.js
new file mode 100644
index 0000000000..b92cc27241
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-getter-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; };
+ *m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-usage.js
new file mode 100644
index 0000000000..121e4ed0d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-method-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; };
+ *m() { return 42; }
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-names.js
new file mode 100644
index 0000000000..b84e8c40bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-private-names.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: private names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y;
+ *m() { return 42; }
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..a30999ed22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier-initializer.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier.js
new file mode 100644
index 0000000000..d8738f7367
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-field-identifier.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter-alt.js
new file mode 100644
index 0000000000..d2a463086c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter-alt.js
@@ -0,0 +1,129 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter.js
new file mode 100644
index 0000000000..7a962fb04c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-getter.js
@@ -0,0 +1,129 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method-alt.js
new file mode 100644
index 0000000000..ec65d1f077
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method.js
new file mode 100644
index 0000000000..a4d1f314f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-method.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter-alt.js
new file mode 100644
index 0000000000..92ff6fdf9e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter.js
new file mode 100644
index 0000000000..ffea3a053a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-private-setter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..9e5db3660d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..523d2b4188
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ *m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..61b169febd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ *m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier.js
new file mode 100644
index 0000000000..d5363502d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..4d8db3cda7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..ba32c03870
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..3ce6f0e650
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ *m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..4a48df4a06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ *m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..47c1a8a3b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..58b378b3e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,126 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..bfbba3ef27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ *m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..053272a202
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-method-privatename-identifier.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ *m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..4f67988589
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ *m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..db3298043c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ *m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..aa47286096
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ *m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..07ee0beb11
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ *m() { return 42; }
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..31cd27ebc8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ *m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..87bf02d5ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ *m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..4bf1312656
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-rs-static-privatename-identifier.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ *m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-fields.js
new file mode 100644
index 0000000000..53dc66f246
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-fields.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: static private fields (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y;
+ *m() { return 42; }
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..3c34cdb121
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods-with-fields.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: static private methods with fields (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal;
+ *m() { return 42; }
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods.js
new file mode 100644
index 0000000000..dad981732c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-static-private-methods.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: static private methods (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ;
+ *m() { return 42; }
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-string-literal-names.js
new file mode 100644
index 0000000000..7eb02935e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-gen-string-literal-names.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-generator.template
+/*---
+description: String literal names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42;
+ *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-names.js
new file mode 100644
index 0000000000..5d0542ad1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-names.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Computed property names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"];
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-symbol-names.js
new file mode 100644
index 0000000000..bd803f7d6b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-computed-symbol-names.js
@@ -0,0 +1,106 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..e9689afbe7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ m() { return 42; }
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names-asi.js
new file mode 100644
index 0000000000..d129d5b54d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names-asi.js
@@ -0,0 +1,78 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names.js
new file mode 100644
index 0000000000..b398718e0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-literal-names.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Literal property names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-field-usage.js
new file mode 100644
index 0000000000..2f434e6efc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-field-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';;
+ m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..7e77888543
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-getter-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; };
+ m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-usage.js
new file mode 100644
index 0000000000..1080b726ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-method-usage.js
@@ -0,0 +1,50 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; };
+ m() { return 42; }
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-names.js
new file mode 100644
index 0000000000..528d48315c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-private-names.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: private names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y;
+ m() { return 42; }
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..3be1c3b0d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier-initializer.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier.js
new file mode 100644
index 0000000000..18c7526633
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-field-identifier.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..08ae8e2531
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter-alt.js
@@ -0,0 +1,129 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter.js
new file mode 100644
index 0000000000..cf1efe33f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-getter.js
@@ -0,0 +1,129 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..879e0826da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method.js
new file mode 100644
index 0000000000..77833ee522
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-method.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..4e70395d0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter.js
new file mode 100644
index 0000000000..f31be2bbfc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-private-setter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..ecd76038ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..8b886724f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..21a0d1d4d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..399f11022a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..7c9f977ba5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..00456077c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..e582704b82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..8a125575fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..0ae6b51ddc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..1e744a920a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,126 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..62711a2759
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..e485228eff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..44e310fef3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..f8a867cf81
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..8d0405da42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..3c32655b04
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ m() { return 42; }
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..42067f88a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..b61e99539f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..7f16bf3771
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-rs-static-privatename-identifier.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-fields.js
new file mode 100644
index 0000000000..5d525ecd2b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-fields.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: static private fields (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y;
+ m() { return 42; }
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..311761f4c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods-with-fields.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: static private methods with fields (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal;
+ m() { return 42; }
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods.js
new file mode 100644
index 0000000000..b86d241aff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-static-private-methods.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: static private methods (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ;
+ m() { return 42; }
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-string-literal-names.js
new file mode 100644
index 0000000000..3a780c2b71
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/new-sc-line-method-string-literal-names.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-new-sc-line-method.template
+/*---
+description: String literal names (field definitions followed by a method in a new line with a semicolon)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42;
+ m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/browser.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWJ.js
new file mode 100644
index 0000000000..ea00382e50
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-ZWJ.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - ZWJ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #ZW_\u200D_J() { return 'get string'; }
+ set #ZW_\u200D_J(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#ZW_‍_J;
+ }
+
+ setPrivateReference(value) {
+ this.#ZW_‍_J = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWNJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWNJ.js
new file mode 100644
index 0000000000..da63e492b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-ZWNJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-ZWNJ.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - ZWNJ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #ZW_\u200C_NJ() { return 'get string'; }
+ set #ZW_\u200C_NJ(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#ZW_‌_NJ;
+ }
+
+ setPrivateReference(value) {
+ this.#ZW_‌_NJ = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u2118.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u2118.js
new file mode 100644
index 0000000000..ce91845729
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u2118.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-u2118.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - u2118 (℘) (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #\u2118() { return 'get string'; }
+ set #\u2118(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#℘;
+ }
+
+ setPrivateReference(value) {
+ this.#℘ = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u6F.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u6F.js
new file mode 100644
index 0000000000..e34cde9544
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-escape-sequence-u6F.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-u6F.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - u6F (o) (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #\u{6F}() { return 'get string'; }
+ set #\u{6F}(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#o;
+ }
+
+ setPrivateReference(value) {
+ this.#o = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWJ.js
new file mode 100644
index 0000000000..984890f647
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-ZWJ.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - ZWJ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #ZW_‍_J() { return 'get string'; }
+ set #ZW_‍_J(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#ZW_‍_J;
+ }
+
+ setPrivateReference(value) {
+ this.#ZW_‍_J = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWNJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWNJ.js
new file mode 100644
index 0000000000..b8ffae141b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-ZWNJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-ZWNJ.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - ZWNJ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #ZW_‌_NJ() { return 'get string'; }
+ set #ZW_‌_NJ(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#ZW_‌_NJ;
+ }
+
+ setPrivateReference(value) {
+ this.#ZW_‌_NJ = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-common.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-common.js
new file mode 100644
index 0000000000..77aa15dba2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-common.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-common.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - common (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #test262() { return 'get string'; }
+ set #test262(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#test262;
+ }
+
+ setPrivateReference(value) {
+ this.#test262 = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-dollar.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-dollar.js
new file mode 100644
index 0000000000..addde8144d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-dollar.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-dollar.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - $ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #$() { return 'get string'; }
+ set #$(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#$;
+ }
+
+ setPrivateReference(value) {
+ this.#$ = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-u2118.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-u2118.js
new file mode 100644
index 0000000000..dee6e5e31e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-u2118.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-u2118.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - ℘ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #℘() { return 'get string'; }
+ set #℘(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#℘;
+ }
+
+ setPrivateReference(value) {
+ this.#℘ = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-underscore.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-underscore.js
new file mode 100644
index 0000000000..435a4c1dc5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/inst-private-name-underscore.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-underscore.case
+// - src/accessor-names/private/cls-private-expr-inst.template
+/*---
+description: Private IdentifierName - _ (Class expression, instance private method)
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ get #_() { return 'get string'; }
+ set #_(param) { stringSet = param; }
+
+ getPrivateReference() {
+ return this.#_;
+ }
+
+ setPrivateReference(value) {
+ this.#_ = value;
+ }
+};
+
+var inst = new C();
+
+assert.sameValue(inst.getPrivateReference(), 'get string');
+
+inst.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/shell.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWJ.js
new file mode 100644
index 0000000000..4c9b23a907
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-ZWJ.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - ZWJ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #ZW_\u200D_J() { return 'get string'; }
+ static set #ZW_\u200D_J(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#ZW_‍_J;
+ }
+
+ static setPrivateReference(value) {
+ this.#ZW_‍_J = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWNJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWNJ.js
new file mode 100644
index 0000000000..39ae6e35e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-ZWNJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-ZWNJ.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - ZWNJ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #ZW_\u200C_NJ() { return 'get string'; }
+ static set #ZW_\u200C_NJ(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#ZW_‌_NJ;
+ }
+
+ static setPrivateReference(value) {
+ this.#ZW_‌_NJ = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u2118.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u2118.js
new file mode 100644
index 0000000000..718768b608
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u2118.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-u2118.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - u2118 (℘) (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #\u2118() { return 'get string'; }
+ static set #\u2118(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#℘;
+ }
+
+ static setPrivateReference(value) {
+ this.#℘ = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u6F.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u6F.js
new file mode 100644
index 0000000000..5d476bbab2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-escape-sequence-u6F.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-escape-sequence-u6F.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - u6F (o) (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #\u{6F}() { return 'get string'; }
+ static set #\u{6F}(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#o;
+ }
+
+ static setPrivateReference(value) {
+ this.#o = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWJ.js
new file mode 100644
index 0000000000..c929640f29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-ZWJ.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - ZWJ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #ZW_‍_J() { return 'get string'; }
+ static set #ZW_‍_J(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#ZW_‍_J;
+ }
+
+ static setPrivateReference(value) {
+ this.#ZW_‍_J = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWNJ.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWNJ.js
new file mode 100644
index 0000000000..b6f07d5aa4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-ZWNJ.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-ZWNJ.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - ZWNJ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #ZW_‌_NJ() { return 'get string'; }
+ static set #ZW_‌_NJ(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#ZW_‌_NJ;
+ }
+
+ static setPrivateReference(value) {
+ this.#ZW_‌_NJ = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-common.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-common.js
new file mode 100644
index 0000000000..8aa5a2c55e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-common.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-common.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - common (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #test262() { return 'get string'; }
+ static set #test262(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#test262;
+ }
+
+ static setPrivateReference(value) {
+ this.#test262 = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-dollar.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-dollar.js
new file mode 100644
index 0000000000..a80a10dd2f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-dollar.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-dollar.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - $ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #$() { return 'get string'; }
+ static set #$(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#$;
+ }
+
+ static setPrivateReference(value) {
+ this.#$ = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-u2118.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-u2118.js
new file mode 100644
index 0000000000..dc1b2b10d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-u2118.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-u2118.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - ℘ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #℘() { return 'get string'; }
+ static set #℘(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#℘;
+ }
+
+ static setPrivateReference(value) {
+ this.#℘ = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-underscore.js b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-underscore.js
new file mode 100644
index 0000000000..245671042b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-accessor-name/static-private-name-underscore.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/accessor-names/private-name-underscore.case
+// - src/accessor-names/private/cls-private-expr-static.template
+/*---
+description: Private IdentifierName - _ (Class expression, static private method)
+features: [class, class-static-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+var stringSet;
+
+var C = class {
+ static get #_() { return 'get string'; }
+ static set #_(param) { stringSet = param; }
+
+ static getPrivateReference() {
+ return this.#_;
+ }
+
+ static setPrivateReference(value) {
+ this.#_ = value;
+ }
+};
+
+
+assert.sameValue(C.getPrivateReference(), 'get string');
+
+C.setPrivateReference('set string');
+assert.sameValue(stringSet, 'set string');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-arguments.js
new file mode 100644
index 0000000000..d1d82b58ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-arrow-fnc.template
+/*---
+description: Syntax error if `arguments` used in class field (private field, arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-super.js
new file mode 100644
index 0000000000..5e8b677e34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-arrow-fnc-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-arrow-fnc.template
+/*---
+description: Syntax error if `super()` used in class field (private field, arrow function expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, arrow-function, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = () => super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-async-generator-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-async-generator-method-name.js
new file mode 100644
index 0000000000..3267d2066e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-async-generator-method-name.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-async-generator-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private async generators methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ AsyncMethod : async [no LineTerminator here] * ClassElementName (UniqueFormalParameters) { AsyncFunctionBody }
+ 1. Let propKey be the result of evaluating ClassElementName.
+ ...
+ 12. Perform ? DefineOrdinaryMethod(key, homeObject, closure, enumerable).
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ async * #method() {};
+
+ getPrivateMethod() {
+ return this.#method;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-async-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-async-method-name.js
new file mode 100644
index 0000000000..e015228345
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-async-method-name.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-async-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private async methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ AsyncMethod : async [no LineTerminator here] ClassElementName (UniqueFormalParameters) { AsyncFunctionBody }
+ 1. Let propKey be the result of evaluating ClassElementName.
+ ...
+ 10. Perform ? DefineOrdinaryMethod(key, homeObject, closure, enumerable).
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ async #method() {};
+
+ getPrivateMethod() {
+ return this.#method;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..8edf52fa00
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-1.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval.template
+/*---
+description: super.x in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super.x;');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..6f53a8d88a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-contains-superproperty-2.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval.template
+/*---
+description: super['x'] in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super["x"];');
+};
+
+new C();
+
+assert.sameValue(executed, true);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..68aeabe77a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval.template
+/*---
+description: error if `super()['x']` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..401d9f416c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval.template
+/*---
+description: error if `super().x` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..56218b200a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-direct-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval.template
+/*---
+description: error if `super()` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = eval('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-1.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-1.js
new file mode 100644
index 0000000000..f7dcbc7327
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-1.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template
+/*---
+description: super.x in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super.x;');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-2.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-2.js
new file mode 100644
index 0000000000..f9677cbf04
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-contains-superproperty-2.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-superproperty-2.case
+// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template
+/*---
+description: super['x'] in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Methods
+
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition.
+
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperProperty.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super["x"];');
+};
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-1.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-1.js
new file mode 100644
index 0000000000..16b1906d5f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-1.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-1.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template
+/*---
+description: error if `super()['x']` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super()["x"];');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-2.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-2.js
new file mode 100644
index 0000000000..935635c223
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall-2.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall-2.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template
+/*---
+description: error if `super().x` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super().x;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall.js b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall.js
new file mode 100644
index 0000000000..30686fd95b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-derived-cls-indirect-eval-err-contains-supercall.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-supercall.case
+// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template
+/*---
+description: error if `super()` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Constructor Methods
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains SuperCall.
+
+---*/
+
+
+var executed = false;
+var A = class {}
+var C = class extends A {
+ #x = (0, eval)('executed = true; super();');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-arguments.js
new file mode 100644
index 0000000000..672a337d8f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-arguments.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-arguments.case
+// - src/class-elements/initializer-direct-eval-arguments/cls-expr-private-fields-eval.template
+/*---
+description: error if `arguments` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if ContainsArguments of StatementList is true.
+ ...
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = eval('executed = true; arguments;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..29c854c4da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-direct-eval-err-contains-newtarget.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-eval.template
+/*---
+description: error if `new.target` in StatementList of eval (direct eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = eval('executed = true; new.target;');
+}
+
+var c = new C();
+
+assert.sameValue(executed, true);
+assert.sameValue(c.x, undefined);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..90eda76aec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-arrow-function.js
@@ -0,0 +1,43 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private field is visible on inner arrow function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #f = 'Test262';
+
+ method() {
+ let arrowFunction = () => {
+ return this.#f;
+ }
+
+ return arrowFunction();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private field from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-function.js
new file mode 100644
index 0000000000..97b6081f82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-access-on-inner-function.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private field is visible on inner function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #f = 'Test262';
+
+ method() {
+ let self = this;
+ function innerFunction() {
+ return self.#f;
+ }
+
+ return innerFunction();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private field from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-after-optional-chain.js b/js/src/tests/test262/language/expressions/class/elements/private-field-after-optional-chain.js
new file mode 100644
index 0000000000..a30f23fb67
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-after-optional-chain.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-after-optional-chain.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: OptionalChain.PrivateIdentifier is a valid syntax (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, optional-chaining, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ OptionalChain[Yield, Await] :
+ `?.` `[` Expression[+In, ?Yield, ?Await] `]`
+ `?.` IdentifierName
+ `?.` Arguments[?Yield, ?Await]
+ `?.` TemplateLiteral[?Yield, ?Await, +Tagged]
+ OptionalChain[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]`
+ OptionalChain[?Yield, ?Await] `.` IdentifierName
+ OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await]
+ OptionalChain[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged]
+ OptionalChain[?Yield, ?Await] `.` PrivateIdentifier
+
+---*/
+
+
+var C = class {
+ #f = 'Test262';
+
+ method(o) {
+ return o?.c.#f;
+ }
+}
+
+let c = new C();
+let o = {c: c};
+assert.sameValue(c.method(o), 'Test262');
+
+assert.sameValue(c.method(null), undefined);
+assert.sameValue(c.method(undefined), undefined);
+
+o = {c: new Object()};
+assert.throws(TypeError, function() {
+ c.method(o);
+}, 'accessed private field from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-as-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/private-field-as-arrow-function.js
new file mode 100644
index 0000000000..395263e4ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-as-arrow-function.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-as-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Calling arrow function returned from private field access (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, arrow-function, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = () => 'test262';
+
+ method() {
+ return this.#m();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-as-async-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/private-field-as-async-arrow-function.js
new file mode 100644
index 0000000000..f91ed215bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-as-async-arrow-function.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-as-async-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Calling async arrow function returned from private field access (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, async-functions, arrow-function, class]
+flags: [generated, async]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = async () => 'test262';
+
+ method() {
+ return this.#m();
+ }
+}
+
+let c = new C();
+
+c.method().then((value) => assert.sameValue(value, 'test262'))
+ .then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-as-async-function.js b/js/src/tests/test262/language/expressions/class/elements/private-field-as-async-function.js
new file mode 100644
index 0000000000..37529243de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-as-async-function.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-as-async-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Calling async function returned from private field access (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, async-functions, class]
+flags: [generated, async]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = async function() { return 'test262'; };
+
+ method() {
+ return this.#m();
+ }
+}
+
+let c = new C();
+
+c.method().then((value) => assert.sameValue(value, 'test262'))
+ .then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-as-function.js b/js/src/tests/test262/language/expressions/class/elements/private-field-as-function.js
new file mode 100644
index 0000000000..65c8e3da41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-as-function.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-as-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Calling result returned from private field access (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = function () { return 'test262'; };
+
+ method() {
+ return this.#m();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-field-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-field-on-nested-class.js
new file mode 100644
index 0000000000..d307e8b74d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-field-on-nested-class.js
@@ -0,0 +1,47 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #outer = 'test262';
+
+ B_withoutPrivateField = class {
+ method(o) {
+ return o.#outer;
+ }
+ }
+
+ B_withPrivateField = class {
+ #inner = 42;
+ method(o) {
+ return o.#outer;
+ }
+ }
+}
+
+let c = new C();
+let innerB1 = new c.B_withoutPrivateField();
+assert.sameValue(innerB1.method(c), 'test262');
+let innerB2 = new c.B_withPrivateField();
+assert.sameValue(innerB2.method(c), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-fields-proxy-default-handler-throws.js b/js/src/tests/test262/language/expressions/class/elements/private-fields-proxy-default-handler-throws.js
new file mode 100644
index 0000000000..0d5c5b62d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-fields-proxy-default-handler-throws.js
@@ -0,0 +1,32 @@
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-privatefieldget
+description: Private fields not accessible via default Proxy handler
+info: |
+ 1. Assert: P is a Private Name value.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. Let entry be PrivateFieldFind(P, O).
+ 4. If entry is empty, throw a TypeError exception.
+
+features: [class, class-fields-private]
+---*/
+
+
+var C = class {
+ #x = 1;
+ x() {
+ return this.#x;
+ }
+}
+
+var c = new C();
+var p = new Proxy(c, {});
+
+assert.sameValue(c.x(), 1);
+assert.throws(TypeError, function() {
+ p.x();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-generator-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-generator-method-name.js
new file mode 100644
index 0000000000..a9d0fcc434
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-generator-method-name.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-generator-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private generator methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ GeneratorMethod : * ClassElementName (UniqueFormalParameters) { GeneratorBody }
+ 1. Let key be the result of evaluating ClassElementName.
+ ...
+ 12. Return DefineOrdinaryMethod(key, homeObject, closure, enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ * #method() {};
+
+ getPrivateMethod() {
+ return this.#method;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..3c30472961
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-arrow-function.js
@@ -0,0 +1,43 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter is visible on inner arrow function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'Test262'; }
+
+ method() {
+ let arrowFunction = () => {
+ return this.#m;
+ }
+
+ return arrowFunction();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private accessor from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-function.js
new file mode 100644
index 0000000000..222384f70d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-access-on-inner-function.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter is visible on inner function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'Test262'; }
+
+ method() {
+ let self = this;
+ function innerFunction() {
+ return self.#m;
+ }
+
+ return innerFunction();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private accessor from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-is-not-a-own-property.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-is-not-a-own-property.js
new file mode 100644
index 0000000000..07c93e8a68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-is-not-a-own-property.js
@@ -0,0 +1,47 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-is-not-a-own-property.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private getter is not stored as an own property of objects (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ a. Let entry be PrivateFieldFind(P, O).
+ b. If entry is empty, throw a TypeError exception.
+ c. Return entry.[[PrivateFieldValue]].
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+---*/
+
+
+var C = class {
+ get #m() { return "Test262"; }
+
+ checkPrivateGetter() {
+ assert.sameValue(this.hasOwnProperty("#m"), false);
+ assert.sameValue("#m" in this, false);
+
+ assert.sameValue(this.__lookupGetter__("#m"), undefined);
+
+ assert.sameValue(this.#m, "Test262");
+
+ return 0;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.checkPrivateGetter(), 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-on-nested-class.js
new file mode 100644
index 0000000000..2422e47496
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-on-nested-class.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter is available on inner classes (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(c), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-field-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-field-on-nested-class.js
new file mode 100644
index 0000000000..c8cd3ffdd7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-field-on-nested-class.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-shadowed-by-field-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter can be shadowed on inner classes by a private field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'outer class'; }
+
+ method() { return this.#m; }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+
+ #m = 'test262';
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(innerB), 'test262');
+assert.sameValue(c.method(), 'outer class');
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'accessed inner class field from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-getter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-getter-on-nested-class.js
new file mode 100644
index 0000000000..4c1da59063
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-getter-on-nested-class.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-shadowed-by-getter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter can be shadowed on inner classes by a private getter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'outer class'; }
+
+ method() { return this.#m; }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+
+ get #m() { return 'test262'; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(innerB), 'test262');
+assert.sameValue(c.method(), 'outer class');
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'accessed inner class getter from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-method-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-method-on-nested-class.js
new file mode 100644
index 0000000000..6d0dd6b812
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-method-on-nested-class.js
@@ -0,0 +1,43 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-shadowed-by-method-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter can be shadowed on inner class by a private method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { throw new Test262Error(); }
+
+ B = class {
+ method(o) {
+ return o.#m();
+ }
+
+ #m() { return 'test262'; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(innerB), 'test262');
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'accessed inner class method from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-setter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-setter-on-nested-class.js
new file mode 100644
index 0000000000..285821fb58
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-getter-shadowed-by-setter-on-nested-class.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-getter-shadowed-by-setter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private getter can be shadowed on inner classes by a private setter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'outer class'; }
+
+ method() { return this.#m; }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+
+ set #m(v) { this._v = v; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+
+assert.throws(TypeError, function() {
+ innerB.method(innerB);
+}, '[[Get]] operation of an accessor without getter');
+
+assert.sameValue(c.method(), 'outer class');
+
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'access of inner class accessor from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-contains-arguments.js
new file mode 100644
index 0000000000..22965b2b41
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-contains-arguments.js
@@ -0,0 +1,26 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-contains-arguments.case
+// - src/class-elements/initializer-indirect-eval-arguments/cls-expr-private-fields-indirect-eval.template
+/*---
+description: No error if `arguments` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, class-fields-public, class-fields-private]
+flags: [generated, noStrict]
+info: |
+ For indirect eval, the "Additional Early Error Rules for Eval Inside Initializer"
+ (in #sec-performeval-rules-in-initializer) are NOT applicable.
+
+---*/
+
+
+var arguments = 1;
+var C = class {
+ #x = (0, eval)('arguments;');
+ x() {
+ return this.#x;
+ }
+}
+
+assert.sameValue(new C().x(), arguments);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-err-contains-newtarget.js b/js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-err-contains-newtarget.js
new file mode 100644
index 0000000000..f835776d84
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-indirect-eval-err-contains-newtarget.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/eval-err-contains-newtarget.case
+// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval.template
+/*---
+description: error if `new.target` in StatementList of eval (indirect eval)
+esid: sec-performeval-rules-in-initializer
+features: [class, new.target, class-fields-private]
+flags: [generated]
+info: |
+ Additional Early Error Rules for Eval Inside Initializer
+ These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.
+ ScriptBody : StatementList
+
+ ...
+ The remaining eval rules apply as outside a constructor, inside a method, and inside a function.
+
+ Additional Early Error Rules for Eval Outside Functions
+ These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
+ ScriptBody : StatementList
+
+ It is a Syntax Error if StatementList Contains NewTarget.
+
+---*/
+
+
+var executed = false;
+var C = class {
+ #x = (0, eval)('executed = true; new.target;');
+}
+
+assert.throws(SyntaxError, function() {
+ new C();
+});
+
+assert.sameValue(executed, false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..1bf29fd4ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-name.template
+/*---
+description: Syntax error if `arguments` used in class field (ClassElementName PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..44f61930da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-literal-name-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-name.template
+/*---
+description: Syntax error if `super()` used in class field (ClassElementName PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..e327187300
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-arrow-function.js
@@ -0,0 +1,43 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method is visible on inner arrow function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'Test262'; }
+
+ method() {
+ let arrowFunction = () => {
+ return this.#m();
+ }
+
+ return arrowFunction();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private method from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-function.js
new file mode 100644
index 0000000000..47257c491b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-access-on-inner-function.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method is visible on inner function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'Test262'; }
+
+ method() {
+ let self = this;
+ function innerFunction() {
+ return self.#m();
+ }
+
+ return innerFunction();
+ }
+}
+
+let c = new C();
+assert.sameValue(c.method(), 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private method from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-comparison.js b/js/src/tests/test262/language/expressions/class/elements/private-method-comparison.js
new file mode 100644
index 0000000000..f941693cad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-comparison.js
@@ -0,0 +1,47 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-comparison.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateFieldGet of a private method returns the same function object to every instance of the same class (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ a. Let entry be PrivateFieldFind(P, O).
+ b. If entry is empty, throw a TypeError exception.
+ c. Return entry.[[PrivateFieldValue]].
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }
+
+ getPrivateMethod() {
+ return this.#m;
+ }
+
+}
+
+let c1 = new C();
+let c2 = new C();
+
+assert.sameValue(c1.getPrivateMethod(), c2.getPrivateMethod());
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-get-and-call.js b/js/src/tests/test262/language/expressions/class/elements/private-method-get-and-call.js
new file mode 100644
index 0000000000..d7c2079be7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-get-and-call.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-get-and-call.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Function returned by a private method can be called with other values as 'this' (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ a. Let entry be PrivateFieldFind(P, O).
+ b. If entry is empty, throw a TypeError exception.
+ c. Return entry.[[PrivateFieldValue]].
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ #m() { return this._v; }
+
+ getPrivateMethod() {
+ return this.#m;
+ }
+
+}
+
+let c = new C();
+
+let o1 = {_v: 'test262'};
+let o2 = {_v: 'foo'};
+assert.sameValue(c.getPrivateMethod().call(o1), 'test262');
+assert.sameValue(c.getPrivateMethod().call(o2), 'foo');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-is-not-a-own-property.js b/js/src/tests/test262/language/expressions/class/elements/private-method-is-not-a-own-property.js
new file mode 100644
index 0000000000..24305b2efa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-is-not-a-own-property.js
@@ -0,0 +1,45 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-is-not-a-own-property.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private method is not stored as an own property of objects (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ a. Let entry be PrivateFieldFind(P, O).
+ b. If entry is empty, throw a TypeError exception.
+ c. Return entry.[[PrivateFieldValue]].
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+---*/
+
+
+var C = class {
+ #m() { return "Test262"; }
+
+ checkPrivateMethod() {
+ assert.sameValue(this.hasOwnProperty("#m"), false);
+ assert.sameValue("#m" in this, false);
+
+ assert.sameValue(this.#m(), "Test262");
+
+ return 0;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.checkPrivateMethod(), 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-length.js b/js/src/tests/test262/language/expressions/class/elements/private-method-length.js
new file mode 100644
index 0000000000..7e433b2756
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-length.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-length.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private methods have length property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : static MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments homeObject, enumerable and "static".
+
+ MethodDefinition : ClassElementName( UniqueFormalParameters ) { FunctionBody }
+ 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ 2. ReturnIfAbrupt(methodDef).
+ 3. Perform ? DefineOrdinaryMethod(methodDef.[[Key]], homeObject, methodDef.[[Closure]], _enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ MethodDefinition : ClassElementName (UniqueFormalParameters) { FunctionBody }
+ ...
+ 8. Let closure be FunctionCreate(kind, UniqueFormalParameters, FunctionBody, scope, privateScope, strict, prototype).
+ 9. Perform MakeMethod(closure, object).
+ 10. Return the Record{[[Key]]: propKey, [[Closure]]: closure}.
+
+---*/
+
+
+var C = class {
+ #method(a) {};
+
+ getPrivateMethod() {
+ return this.#method;
+ }
+
+}
+
+let c = new C();
+assert.sameValue(c.getPrivateMethod().length, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-method-on-nested-class.js
new file mode 100644
index 0000000000..5b22a3f4fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-on-nested-class.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method is available on inner classes (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }
+
+ B = class {
+ method(o) {
+ return o.#m();
+ }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(c), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-referenced-from-static-method.js b/js/src/tests/test262/language/expressions/class/elements/private-method-referenced-from-static-method.js
new file mode 100644
index 0000000000..cb9a0aa261
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-referenced-from-static-method.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-referenced-from-static-method.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private method referenced from a static method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ #f() { return 42; }
+ static g() {
+ return this.#f();
+ }
+
+}
+
+assert.sameValue(C.g.call(new C()), 42);
+assert.throws(TypeError, function() {
+ C.g();
+}, 'Accessed private method from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-field-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-field-on-nested-class.js
new file mode 100644
index 0000000000..0ae9963eef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-field-on-nested-class.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-shadowed-by-field-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method can be shadowed on inner classes by a private field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'outer class'; }
+
+ method() { return this.#m(); }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+
+ #m = 'test262';
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(innerB), 'test262');
+assert.sameValue(c.method(), 'outer class');
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'accessed inner class field from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-getter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-getter-on-nested-class.js
new file mode 100644
index 0000000000..e35c3d056d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-getter-on-nested-class.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-shadowed-by-getter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method can be shadowed on inner classes by a private getter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'outer class'; }
+
+ method() { return this.#m(); }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+
+ get #m() { return 'test262'; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(innerB), 'test262');
+assert.sameValue(c.method(), 'outer class');
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'accessed inner class getter from an object of outer class');
+assert.throws(TypeError, function() {
+ C.prototype.method.call(innerB);
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-setter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-setter-on-nested-class.js
new file mode 100644
index 0000000000..9590c71524
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-by-setter-on-nested-class.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-shadowed-by-setter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method can be shadowed on inner classes by a private setter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'outer class'; }
+
+ method() { return this.#m(); }
+
+ B = class {
+ method(o) {
+ return o.#m;
+ }
+
+ set #m(v) { this._v = v; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+
+assert.throws(TypeError, function() {
+ innerB.method(innerB);
+}, '[[Get]] operation of an accessor without getter');
+
+assert.sameValue(c.method(), 'outer class');
+
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'access of inner class accessor from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-on-nested-class.js
new file mode 100644
index 0000000000..c503eeaa3e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-method-shadowed-on-nested-class.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-shadowed-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private method can be shadowed by inner class private method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { throw new Test262Error(); }
+
+ B = class {
+ method() {
+ return this.#m();
+ }
+
+ #m() { return 'test262'; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+assert.sameValue(innerB.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/browser.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-generator.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-generator.js
new file mode 100644
index 0000000000..a7af985bbf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-generator.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-async-generator.case
+// - src/class-elements/private-methods/cls-expr.template
+/*---
+description: Private Async Generator (private method definitions in a class expression)
+esid: prod-MethodDefinition
+features: [async-iteration, class, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ GeneratorMethod
+ AsyncMethod
+ AsyncGeneratorMethod
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){GeneratorBody}
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ ---
+
+ InitializeClassElements ( F, proto )
+
+ ...
+ 5. For each item element in order from elements,
+ a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name.
+ b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype",
+ i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto.
+ ii. Perform ? DefineClassElement(receiver, element).
+
+ InitializeInstanceElements ( O, constructor )
+
+ ...
+ 3. Let elements be the value of F's [[Elements]] internal slot.
+ 4. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "method",
+ i. Perform ? DefineClassElement(O, element).
+
+ DefineClassElement (receiver, element)
+
+ ...
+ 6. If key is a Private Name,
+ a. Perform ? PrivateFieldDefine(receiver, key, descriptor).
+
+ PrivateFieldDefine (P, O, desc)
+
+ ...
+ 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]].
+
+---*/
+var ctorPromise;
+
+
+
+/***
+ * template notes:
+ * 1. method should always be #m
+ * 2. the template provides c.ref/other.ref for external reference
+ */
+
+function hasProp(obj, name, expected, msg) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name);
+ assert.sameValue(hasOwnProperty, expected, msg);
+
+ var hasProperty = Reflect.has(obj, name);
+ assert.sameValue(hasProperty, expected, msg);
+}
+
+var C = class {
+ async * #m() { return 42; }
+
+
+ get ref() { return this.#m; }
+
+ constructor() {
+ hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
+ assert.sameValue(typeof this.#m, 'function');
+ assert.sameValue(this.ref, this.#m, 'returns the same value');
+ assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
+
+ var ctorIter = this.#m();
+ var p = ctorIter.next();
+ ctorPromise = p.then(({ value, done }) => {
+ assert.sameValue(value, 42, 'return from generator method, inside ctor');
+ assert.sameValue(done, true, 'iterator is done, inside ctor');
+ }, $DONE);
+ assert.sameValue(this.#m.name, '#m', 'function name inside constructor');
+
+ }
+}
+
+var c = new C();
+var other = new C();
+
+hasProp(C.prototype, '#m', false, 'method is not defined in the prototype');
+hasProp(C, '#m', false, 'method is not defined in the contructor');
+hasProp(c, '#m', false, 'method cannot be seen outside of the class');
+
+/***
+ * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ *
+ * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ * ...
+ */
+assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance');
+
+assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference');
+ctorPromise.then(() => {
+ // gets the returned async iterator from #m
+ var iter = c.ref();
+ return iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42, 'return from generator method');
+ assert.sameValue(done, true, 'iterator is done');
+ });
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-method.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-method.js
new file mode 100644
index 0000000000..8fd52c6c2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-async-method.js
@@ -0,0 +1,130 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-async-method.case
+// - src/class-elements/private-methods/cls-expr.template
+/*---
+description: Private Async Method (private method definitions in a class expression)
+esid: prod-MethodDefinition
+features: [async-functions, class, class-methods-private]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ GeneratorMethod
+ AsyncMethod
+ AsyncGeneratorMethod
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){GeneratorBody}
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ ---
+
+ InitializeClassElements ( F, proto )
+
+ ...
+ 5. For each item element in order from elements,
+ a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name.
+ b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype",
+ i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto.
+ ii. Perform ? DefineClassElement(receiver, element).
+
+ InitializeInstanceElements ( O, constructor )
+
+ ...
+ 3. Let elements be the value of F's [[Elements]] internal slot.
+ 4. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "method",
+ i. Perform ? DefineClassElement(O, element).
+
+ DefineClassElement (receiver, element)
+
+ ...
+ 6. If key is a Private Name,
+ a. Perform ? PrivateFieldDefine(receiver, key, descriptor).
+
+ PrivateFieldDefine (P, O, desc)
+
+ ...
+ 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]].
+
+---*/
+var ctorPromise;
+
+
+
+/***
+ * template notes:
+ * 1. method should always be #m
+ * 2. the template provides c.ref/other.ref for external reference
+ */
+
+function hasProp(obj, name, expected, msg) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name);
+ assert.sameValue(hasOwnProperty, expected, msg);
+
+ var hasProperty = Reflect.has(obj, name);
+ assert.sameValue(hasProperty, expected, msg);
+}
+
+var C = class {
+ async #m() { return 42; }
+
+
+ get ref() { return this.#m; }
+
+ constructor() {
+ hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
+ assert.sameValue(typeof this.#m, 'function');
+ assert.sameValue(this.ref, this.#m, 'returns the same value');
+ assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
+
+ assert.sameValue(this.#m.name, '#m', 'function name inside constructor');
+ ctorPromise = this.#m().then(value => {
+ assert.sameValue(value, 42, 'already defined in the ctor');
+ }, $DONE);
+
+ }
+}
+
+var c = new C();
+var other = new C();
+
+hasProp(C.prototype, '#m', false, 'method is not defined in the prototype');
+hasProp(C, '#m', false, 'method is not defined in the contructor');
+hasProp(c, '#m', false, 'method cannot be seen outside of the class');
+
+/***
+ * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ *
+ * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ * ...
+ */
+assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance');
+
+assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference');
+ctorPromise.then(() => {
+ // gets the returned promise from #m
+ return c.ref().then(value => {
+ assert.sameValue(value, 42, 'function return');
+ });
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-generator.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-generator.js
new file mode 100644
index 0000000000..0dc3c122d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-generator.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-generator.case
+// - src/class-elements/private-methods/cls-expr.template
+/*---
+description: Private Generator (private method definitions in a class expression)
+esid: prod-MethodDefinition
+features: [generators, class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ GeneratorMethod
+ AsyncMethod
+ AsyncGeneratorMethod
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){GeneratorBody}
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ ---
+
+ InitializeClassElements ( F, proto )
+
+ ...
+ 5. For each item element in order from elements,
+ a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name.
+ b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype",
+ i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto.
+ ii. Perform ? DefineClassElement(receiver, element).
+
+ InitializeInstanceElements ( O, constructor )
+
+ ...
+ 3. Let elements be the value of F's [[Elements]] internal slot.
+ 4. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "method",
+ i. Perform ? DefineClassElement(O, element).
+
+ DefineClassElement (receiver, element)
+
+ ...
+ 6. If key is a Private Name,
+ a. Perform ? PrivateFieldDefine(receiver, key, descriptor).
+
+ PrivateFieldDefine (P, O, desc)
+
+ ...
+ 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]].
+
+---*/
+
+
+/***
+ * template notes:
+ * 1. method should always be #m
+ * 2. the template provides c.ref/other.ref for external reference
+ */
+
+function hasProp(obj, name, expected, msg) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name);
+ assert.sameValue(hasOwnProperty, expected, msg);
+
+ var hasProperty = Reflect.has(obj, name);
+ assert.sameValue(hasProperty, expected, msg);
+}
+
+var C = class {
+ * #m() { return 42; }
+
+
+ get ref() { return this.#m; }
+
+ constructor() {
+ hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
+ assert.sameValue(typeof this.#m, 'function');
+ assert.sameValue(this.ref, this.#m, 'returns the same value');
+ assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
+
+ var res = this.#m().next();
+ assert.sameValue(res.value, 42, 'return from generator method, inside ctor');
+ assert.sameValue(res.done, true, 'iterator is done, inside ctor');
+ assert.sameValue(this.#m.name, '#m', 'function name inside constructor');
+
+ }
+}
+
+var c = new C();
+var other = new C();
+
+hasProp(C.prototype, '#m', false, 'method is not defined in the prototype');
+hasProp(C, '#m', false, 'method is not defined in the contructor');
+hasProp(c, '#m', false, 'method cannot be seen outside of the class');
+
+/***
+ * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ *
+ * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ * ...
+ */
+assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance');
+
+// gets the returned iterator from #m
+var res = c.ref().next();
+assert.sameValue(res.value, 42, 'return from generator method');
+assert.sameValue(res.done, true, 'iterator is done');
+assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js
new file mode 100644
index 0000000000..71d6ac4a3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js
@@ -0,0 +1,142 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-method-initialize-order.case
+// - src/class-elements/private-methods/cls-expr.template
+/*---
+description: Private methods are added before any field initializer is run, even if they appear textually later (private method definitions in a class expression)
+esid: prod-MethodDefinition
+features: [class-methods-private, class-fields-private, class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ GeneratorMethod
+ AsyncMethod
+ AsyncGeneratorMethod
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){GeneratorBody}
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ ---
+
+ InitializeClassElements ( F, proto )
+
+ ...
+ 5. For each item element in order from elements,
+ a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name.
+ b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype",
+ i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto.
+ ii. Perform ? DefineClassElement(receiver, element).
+
+ InitializeInstanceElements ( O, constructor )
+
+ ...
+ 3. Let elements be the value of F's [[Elements]] internal slot.
+ 4. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "method",
+ i. Perform ? DefineClassElement(O, element).
+
+ DefineClassElement (receiver, element)
+
+ ...
+ 6. If key is a Private Name,
+ a. Perform ? PrivateFieldDefine(receiver, key, descriptor).
+
+ PrivateFieldDefine (P, O, desc)
+
+ ...
+ 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]].
+
+
+ InitializeInstanceElements ( O, constructor )
+ ...
+ 4. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "method",
+ i. Perform ? DefineClassElement(O, element).
+ 5. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "field",
+ i. Assert: element.[[Descriptor]] does not have a [[Value]], [[Get]] or [[Set]] slot.
+ ii. Perform ? DefineClassElement(O, element).
+ 6. Return.
+
+ EDITOR'S NOTE:
+ Value properties are added before initializers so that private methods are visible from all initializers.
+
+---*/
+
+
+/***
+ * template notes:
+ * 1. method should always be #m
+ * 2. the template provides c.ref/other.ref for external reference
+ */
+
+function hasProp(obj, name, expected, msg) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name);
+ assert.sameValue(hasOwnProperty, expected, msg);
+
+ var hasProperty = Reflect.has(obj, name);
+ assert.sameValue(hasProperty, expected, msg);
+}
+
+var C = class {
+ a = this.#m();
+
+ #m() { return 42; }
+ get bGetter() { return this.#b; }
+
+ #b = this.#m();
+
+
+ get ref() { return this.#m; }
+
+ constructor() {
+ hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
+ assert.sameValue(typeof this.#m, 'function');
+ assert.sameValue(this.ref, this.#m, 'returns the same value');
+ assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
+
+ assert.sameValue(this.a, 42);
+ assert.sameValue(this.#b, 42);
+
+ }
+}
+
+var c = new C();
+var other = new C();
+
+hasProp(C.prototype, '#m', false, 'method is not defined in the prototype');
+hasProp(C, '#m', false, 'method is not defined in the contructor');
+hasProp(c, '#m', false, 'method cannot be seen outside of the class');
+
+/***
+ * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ *
+ * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ * ...
+ */
+assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance');
+
+assert.sameValue(c.a, 42);
+assert.sameValue(c.bGetter, 42);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method.js
new file mode 100644
index 0000000000..cd735bea4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/prod-private-method.js
@@ -0,0 +1,123 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-method.case
+// - src/class-elements/private-methods/cls-expr.template
+/*---
+description: Private Method (private method definitions in a class expression)
+esid: prod-MethodDefinition
+features: [class, class-methods-private]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ GeneratorMethod
+ AsyncMethod
+ AsyncGeneratorMethod
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){GeneratorBody}
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ ---
+
+ InitializeClassElements ( F, proto )
+
+ ...
+ 5. For each item element in order from elements,
+ a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name.
+ b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype",
+ i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto.
+ ii. Perform ? DefineClassElement(receiver, element).
+
+ InitializeInstanceElements ( O, constructor )
+
+ ...
+ 3. Let elements be the value of F's [[Elements]] internal slot.
+ 4. For each item element in order from elements,
+ a. If element.[[Placement]] is "own" and element.[[Kind]] is "method",
+ i. Perform ? DefineClassElement(O, element).
+
+ DefineClassElement (receiver, element)
+
+ ...
+ 6. If key is a Private Name,
+ a. Perform ? PrivateFieldDefine(receiver, key, descriptor).
+
+ PrivateFieldDefine (P, O, desc)
+
+ ...
+ 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]].
+
+---*/
+
+
+/***
+ * template notes:
+ * 1. method should always be #m
+ * 2. the template provides c.ref/other.ref for external reference
+ */
+
+function hasProp(obj, name, expected, msg) {
+ var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name);
+ assert.sameValue(hasOwnProperty, expected, msg);
+
+ var hasProperty = Reflect.has(obj, name);
+ assert.sameValue(hasProperty, expected, msg);
+}
+
+var C = class {
+ #m() { return 42; }
+
+
+ get ref() { return this.#m; }
+
+ constructor() {
+ hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
+ assert.sameValue(typeof this.#m, 'function');
+ assert.sameValue(this.ref, this.#m, 'returns the same value');
+ assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
+
+ assert.sameValue(this.#m(), 42, 'already defined in the ctor');
+ assert.sameValue(this.#m.name, '#m', 'function name inside constructor');
+
+ }
+}
+
+var c = new C();
+var other = new C();
+
+hasProp(C.prototype, '#m', false, 'method is not defined in the prototype');
+hasProp(C, '#m', false, 'method is not defined in the contructor');
+hasProp(c, '#m', false, 'method cannot be seen outside of the class');
+
+/***
+ * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ *
+ * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ * ...
+ */
+assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance');
+
+// gets the returned value from #m
+assert.sameValue(c.ref(), 42, 'function return');
+assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-methods/shell.js b/js/src/tests/test262/language/expressions/class/elements/private-methods/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-methods/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..fd5bab9db1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-arrow-function.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter is visible on inner arrow function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ method() {
+ let arrowFunction = () => {
+ this.#m = 'Test262';
+ }
+
+ arrowFunction();
+ }
+}
+
+let c = new C();
+c.method();
+assert.sameValue(c._v, 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private setter from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-function.js
new file mode 100644
index 0000000000..b62c896a4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-access-on-inner-function.js
@@ -0,0 +1,45 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter is visible on inner function of class scope (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ method() {
+ let self = this;
+ function innerFunction() {
+ self.#m = 'Test262';
+ }
+
+ innerFunction();
+ }
+}
+
+let c = new C();
+c.method();
+assert.sameValue(c._v, 'Test262');
+let o = {};
+assert.throws(TypeError, function() {
+ c.method.call(o);
+}, 'accessed private setter from an ordinary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-is-not-a-own-property.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-is-not-a-own-property.js
new file mode 100644
index 0000000000..3ec0eab9a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-is-not-a-own-property.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-is-not-a-own-property.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private setter is not stored as an own property of objects (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ a. Let entry be PrivateFieldFind(P, O).
+ b. If entry is empty, throw a TypeError exception.
+ c. Return entry.[[PrivateFieldValue]].
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ checkPrivateSetter() {
+ assert.sameValue(this.hasOwnProperty("#m"), false);
+ assert.sameValue("#m" in this, false);
+
+ assert.sameValue(this.__lookupSetter__("#m"), undefined);
+
+ this.#m = "Test262";
+ assert.sameValue(this._v, "Test262");
+
+ return 0;
+ }
+}
+
+let c = new C();
+assert.sameValue(c.checkPrivateSetter(), 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-on-nested-class.js
new file mode 100644
index 0000000000..08111943fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-on-nested-class.js
@@ -0,0 +1,39 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter is available on inner classes (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ B = class {
+ method(o, v) {
+ o.#m = v;
+ }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+innerB.method(c, 'test262');
+assert.sameValue(c._v, 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-field-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-field-on-nested-class.js
new file mode 100644
index 0000000000..187b009b9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-field-on-nested-class.js
@@ -0,0 +1,53 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-shadowed-by-field-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter can be shadowed on inner classes by a private field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ method(v) { this.#m = v; }
+
+ B = class {
+ method(o, v) {
+ o.#m = v;
+ }
+
+ get m() { return this.#m; }
+
+ #m;
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+
+innerB.method(innerB, 'test262');
+assert.sameValue(innerB.m, 'test262');
+
+c.method('outer class');
+assert.sameValue(c._v, 'outer class');
+
+assert.throws(TypeError, function() {
+ innerB.method(c, 'foo');
+}, 'accessed inner class field from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-getter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-getter-on-nested-class.js
new file mode 100644
index 0000000000..7105e2d77c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-getter-on-nested-class.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-shadowed-by-getter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter can be shadowed on inner classes by a private getter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ method(v) { this.#m = v; }
+
+ B = class {
+ method(o, v) {
+ o.#m = v;
+ }
+
+ get #m() { return 'test262'; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+
+assert.throws(TypeError, function() {
+ innerB.method(innerB);
+}, 'invalid [[Set]] of an acessor without setter');
+
+c.method('outer class');
+assert.sameValue(c._v, 'outer class');
+
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'invalid access of inner class getter from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-method-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-method-on-nested-class.js
new file mode 100644
index 0000000000..d261d4c492
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-method-on-nested-class.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-shadowed-by-method-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter can be shadowed on inner class by a private method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ method(v) { this.#m = v; }
+
+ B = class {
+ method(o, v) {
+ o.#m = v;
+ }
+
+ #m() { return 'test262'; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+
+assert.throws(TypeError, function() {
+ innerB.method(innerB, 'foo');
+}, 'invalid [[Set]] operation in a private method');
+
+c.method('outer class');
+assert.sameValue(c._v, 'outer class');
+
+assert.throws(TypeError, function() {
+ innerB.method(c);
+}, 'invalid access of inner class method from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-setter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-setter-on-nested-class.js
new file mode 100644
index 0000000000..9e9bad52eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-setter-shadowed-by-setter-on-nested-class.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-setter-shadowed-by-setter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private setter can be shadowed on inner classes by a private setter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ set #m(v) { this._v = v; }
+
+ method(v) { this.#m = v; }
+
+ B = class {
+ method(o, v) {
+ o.#m = v;
+ }
+
+ set #m(v) { this._v = v; }
+ }
+}
+
+let c = new C();
+let innerB = new c.B();
+
+innerB.method(innerB, 'test262');
+assert.sameValue(innerB._v, 'test262');
+
+c.method('outer class');
+assert.sameValue(c._v, 'outer class');
+
+assert.throws(TypeError, function() {
+ innerB.method(c, 'foo');
+}, 'access of inner class accessor from an object of outer class');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-async-generator-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-static-async-generator-method-name.js
new file mode 100644
index 0000000000..29ac94d614
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-async-generator-method-name.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-async-generator-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private static async generator methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : static MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments homeObject, enumerable and "static".
+
+ AsyncMethod : async [no LineTerminator here] * ClassElementName (UniqueFormalParameters) { AsyncFunctionBody }
+ ...
+ 12. Perform ? DefineOrdinaryMethod(key, homeObject, closure, _enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ static async * #method() {};
+
+ static getPrivateMethod() {
+ return this.#method;
+ }
+}
+
+assert.sameValue(C.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-async-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-static-async-method-name.js
new file mode 100644
index 0000000000..8e147e4933
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-async-method-name.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-async-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private static async methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : static MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments homeObject, enumerable and "static".
+
+ AsyncMethod : async [no LineTerminator here] ClassElementName (UniqueFormalParameters) { AsyncFunctionBody }
+ ...
+ 10. Perform ? DefineOrdinaryMethod(key, homeObject, closure, _enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ static async #method() {};
+
+ static getPrivateMethod() {
+ return this.#method;
+ }
+}
+
+assert.sameValue(C.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-field-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-field-on-nested-class.js
new file mode 100644
index 0000000000..70ca8ba444
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-field-on-nested-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-field-shadowed-by-field-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static field can be shadowed on inner classes by a private field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class-fields-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m = 'outer class';
+
+ static fieldAccess() {
+ return this.#m;
+ }
+
+ static B = class {
+ #m = 'inner class';
+ static fieldAccess(o) {
+ return o.#m;
+ }
+ }
+}
+
+assert.sameValue(C.fieldAccess(), 'outer class');
+
+let b = new C.B();
+
+assert.sameValue(C.B.fieldAccess(b), 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.fieldAccess(C);
+}, 'accessed private field from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-getter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-getter-on-nested-class.js
new file mode 100644
index 0000000000..dd418effc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-getter-on-nested-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-field-shadowed-by-getter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static field can be shadowed on inner classes by a private getter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m = 'outer class';
+
+ static fieldAccess() {
+ return this.#m;
+ }
+
+ static B = class {
+ get #m() { return 'inner class'; }
+
+ static access(o) {
+ return o.#m;
+ }
+ }
+}
+
+assert.sameValue(C.fieldAccess(), 'outer class');
+
+let b = new C.B();
+
+assert.sameValue(C.B.access(b), 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.access(C);
+}, 'accessed private getter from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-method-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-method-on-nested-class.js
new file mode 100644
index 0000000000..45d1507a04
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-method-on-nested-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-field-shadowed-by-method-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static field can be shadowed on inner classes by a private method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m = () => 'outer class';
+
+ static fieldAccess() {
+ return this.#m();
+ }
+
+ static B = class {
+ #m() { return 'inner class'; }
+
+ static access(o) {
+ return o.#m();
+ }
+ }
+}
+
+assert.sameValue(C.fieldAccess(), 'outer class');
+
+let b = new C.B();
+
+assert.sameValue(C.B.access(b), 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.access(C);
+}, 'accessed private method from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-setter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-setter-on-nested-class.js
new file mode 100644
index 0000000000..e6741b5096
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-field-shadowed-by-setter-on-nested-class.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-field-shadowed-by-setter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static field can be shadowed on inner classes by a private setter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m = 'outer class';
+
+ static fieldAccess() {
+ return this.#m;
+ }
+
+ static B = class {
+ set #m(v) { this._v = v; }
+
+ static access(o) {
+ o.#m = 'inner class';
+ }
+ }
+}
+
+assert.sameValue(C.fieldAccess(), 'outer class');
+
+let b = new C.B();
+
+C.B.access(b);
+assert.sameValue(b._v, 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.access(C);
+}, 'accessed private setter from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-field-usage-inside-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-field-usage-inside-nested-class.js
new file mode 100644
index 0000000000..74c749b205
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-field-usage-inside-nested-class.js
@@ -0,0 +1,81 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-field-usage-inside-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static field is available inside inner classes (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m = 'outer class';
+
+ static B = class {
+ static fieldAccess(o) {
+ return o.#m;
+ }
+ }
+}
+
+assert.sameValue(C.B.fieldAccess(C), 'outer class');
+assert.throws(TypeError, function() {
+ C.B.methodAccess(C.B);
+}, 'accessed static private field from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-generator-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-static-generator-method-name.js
new file mode 100644
index 0000000000..f87da5ed61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-generator-method-name.js
@@ -0,0 +1,62 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-generator-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private static generator methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : static MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments homeObject, enumerable and "static".
+
+ GeneratorMethod : * ClassElementName (UniqueFormalParameters) { GeneratorBody }
+ ...
+ 12. Perform ? DefineOrdinaryMethod(key, homeObject, closure, _enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ static * #method() {};
+
+ static getPrivateMethod() {
+ return this.#method;
+ }
+}
+
+assert.sameValue(C.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-length.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-length.js
new file mode 100644
index 0000000000..fee1b446bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-length.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-length.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private static methods have length property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : static MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments homeObject, enumerable and "static".
+
+ MethodDefinition : ClassElementName( UniqueFormalParameters ) { FunctionBody }
+ 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ 2. ReturnIfAbrupt(methodDef).
+ 3. Perform ? DefineOrdinaryMethod(methodDef.[[Key]], homeObject, methodDef.[[Closure]], _enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ MethodDefinition : ClassElementName (UniqueFormalParameters) { FunctionBody }
+ ...
+ 8. Let closure be FunctionCreate(kind, UniqueFormalParameters, FunctionBody, scope, privateScope, strict, prototype).
+ 9. Perform MakeMethod(closure, object).
+ 10. Return the Record{[[Key]]: propKey, [[Closure]]: closure}.
+
+---*/
+
+
+var C = class {
+ static #method(a, b, c) {};
+
+ static getPrivateMethod() {
+ return this.#method;
+ }
+
+}
+
+assert.sameValue(C.getPrivateMethod().length, 3);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-name.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-name.js
new file mode 100644
index 0000000000..992817e19b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-name.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private static methods have name property properly configured (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement : MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments ! Get(homeObject, "prototype"),enumerable, and "prototype".
+
+ ClassElement : static MethodDefinition
+ 1. Return ClassElementEvaluation of MethodDefinition with arguments homeObject, enumerable and "static".
+
+ MethodDefinition : ClassElementName( UniqueFormalParameters ) { FunctionBody }
+ 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject.
+ 2. ReturnIfAbrupt(methodDef).
+ 3. Perform ? DefineOrdinaryMethod(methodDef.[[Key]], homeObject, methodDef.[[Closure]], _enumerable).
+
+ ClassElement : MethodDefinition
+ ClassElement : static MethodDefinition
+ 1. Perform ? PropertyDefinitionEvaluation with parameters object and enumerable.
+ 2. Return empty.
+
+ MethodDefinition : ClassElementName (UniqueFormalParameters) { FunctionBody }
+ 1. Let propKey be the result of evaluating ClassElementName.
+ ...
+ 8. Let closure be FunctionCreate(kind, UniqueFormalParameters, FunctionBody, scope, privateScope, strict, prototype).
+ 9. Perform MakeMethod(closure, object).
+ 10. Return the Record{[[Key]]: propKey, [[Closure]]: closure}.
+
+ ClassElementName : PrivateIdentifier
+ 1. Let bindingName be StringValue of PrivateIdentifier.
+ ...
+ 5. If scopeEnvRec's binding for bindingName is uninitialized,
+ a. Let field be NewPrivateName(bindingName).
+ b. Perform ! scopeEnvRec.InitializeBinding(bindingName, field).
+ 6. Otherwise,
+ a. Let field be scopeEnvRec.GetBindingValue(bindingName).
+ 7. Assert: field.[[Description]] is bindingName.
+ 8. Return field.
+
+ DefineOrdinaryMethod(key, homeObject, closure, enumerable)
+ 1. Perform SetFunctionName(closure, key).
+ 2. If key is a Private Name,
+ a. Assert: key does not have a [[Kind]] field.
+ b. Set key.[[Kind]] to "method".
+ c. Set key.[[Value]] to closure.
+ d. Set key.[[Brand]] to homeObject.
+ 3. Else,
+ a. Let desc be the PropertyDescriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.
+ b. Perform ? DefinePropertyOrThrow(homeObject, key, desc).
+
+---*/
+
+
+var C = class {
+ static #method() {
+ return 'Test262';
+ };
+
+ static getPrivateMethod() {
+ return this.#method;
+ }
+
+}
+
+assert.sameValue(C.getPrivateMethod().name, "#method");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-field-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-field-on-nested-class.js
new file mode 100644
index 0000000000..e4ee3b42e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-field-on-nested-class.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-shadowed-by-field-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static method can be shadowed on inner classes by a private field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class-fields-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m() { return 'outer class'; }
+
+ static methodAccess() {
+ return this.#m();
+ }
+
+ static B = class {
+ #m = 'inner class';
+ static fieldAccess(o) {
+ return o.#m;
+ }
+ }
+}
+
+assert.sameValue(C.methodAccess(), 'outer class');
+
+let b = new C.B();
+
+assert.sameValue(C.B.fieldAccess(b), 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.fieldAccess(C);
+}, 'accessed private field from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-getter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-getter-on-nested-class.js
new file mode 100644
index 0000000000..e685307c0b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-getter-on-nested-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-shadowed-by-getter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static method can be shadowed on inner classes by a private getter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m() { return 'outer class'; }
+
+ static methodAccess() {
+ return this.#m();
+ }
+
+ static B = class {
+ get #m() { return 'inner class'; }
+
+ static access(o) {
+ return o.#m;
+ }
+ }
+}
+
+assert.sameValue(C.methodAccess(), 'outer class');
+
+let b = new C.B();
+
+assert.sameValue(C.B.access(b), 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.access(C);
+}, 'accessed private getter from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-method-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-method-on-nested-class.js
new file mode 100644
index 0000000000..19def12e06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-method-on-nested-class.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-shadowed-by-method-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static method can be shadowed on inner classes by a private method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m() { return 'outer class'; }
+
+ static methodAccess() {
+ return this.#m();
+ }
+
+ static B = class {
+ #m() { return 'inner class'; }
+
+ static access(o) {
+ return o.#m();
+ }
+ }
+}
+
+assert.sameValue(C.methodAccess(), 'outer class');
+
+let b = new C.B();
+
+assert.sameValue(C.B.access(b), 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.access(C);
+}, 'accessed private method from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-setter-on-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-setter-on-nested-class.js
new file mode 100644
index 0000000000..a38ea9ec0d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-shadowed-by-setter-on-nested-class.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-shadowed-by-setter-on-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static method can be shadowed on inner classes by a private setter (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class-methods-private, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m() { return 'outer class'; }
+
+ static methodAccess() {
+ return this.#m();
+ }
+
+ static B = class {
+ set #m(v) { this._v = v; }
+
+ static access(o) {
+ o.#m = 'inner class';
+ }
+ }
+}
+
+assert.sameValue(C.methodAccess(), 'outer class');
+
+let b = new C.B();
+
+C.B.access(b);
+assert.sameValue(b._v, 'inner class');
+
+assert.throws(TypeError, function() {
+ C.B.access(C);
+}, 'accessed private setter from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-static-method-usage-inside-nested-class.js b/js/src/tests/test262/language/expressions/class/elements/private-static-method-usage-inside-nested-class.js
new file mode 100644
index 0000000000..7176cf165a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-static-method-usage-inside-nested-class.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-static-method-usage-inside-nested-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: PrivateName of private static method is available inside inner classes (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateIdentifier
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ ...
+ 15. Set the running execution context's LexicalEnvironment to classScope.
+ 16. Set the running execution context's PrivateEnvironment to classPrivateEnvironment.
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ FieldDefinition : ClassElementName Initializer_opt
+ 1. Let name be the result of evaluating ClassElementName.
+ 2. ReturnIfAbrupt(name).
+ 3. If Initializer_opt is present,
+ a. Let lex be the Lexical Environment of the running execution context.
+ b. Let formalParameterList be an instance of the production FormalParameters : [empty].
+ c. Let privateScope be the PrivateEnvironment of the running execution context.
+ d. Let initializer be FunctionCreate(Method, formalParameterList, Initializer, lex, true, privateScope).
+ e. Perform MakeMethod(initializer, homeObject).
+ f. Let isAnonymousFunctionDefinition be IsAnonymousFunctionDefinition(Initializer).
+ 4. Else,
+ a. Let initializer be empty.
+ b. Let isAnonymousFunctionDeclaration be false.
+ 5. Return a Record { [[Name]]: name, [[Initializer]]: initializer, [[IsAnonymousFunctionDefinition]]: isAnonymousFunctionDefinition }.
+
+ MemberExpression : MemberExpression.PrivateIdentifier
+ 1. Let baseReference be the result of evaluating MemberExpression.
+ 2. Let baseValue be ? GetValue(baseReference).
+ 3. Let bv be ? RequireObjectCoercible(baseValue).
+ 4. Let fieldNameString be the StringValue of PrivateIdentifier.
+ 5. Return MakePrivateReference(bv, fieldNameString).
+
+ MakePrivateReference(baseValue, privateIdentifier)
+ 1. Let env be the running execution context's PrivateEnvironment.
+ 2. Let privateNameBinding be ? ResolveBinding(privateIdentifier, env).
+ 3. Let privateName be GetValue(privateNameBinding).
+ 4. Assert: privateName is a Private Name.
+ 5. Return a value of type Reference whose base value is baseValue, whose referenced name is privateName, whose strict reference flag is true.
+
+---*/
+
+
+var C = class {
+ static #m() {
+ return 'outer class';
+ }
+
+ static B = class {
+ static methodAccess(o) {
+ return o.#m();
+ }
+ }
+}
+
+assert.sameValue(C.B.methodAccess(C), 'outer class');
+assert.throws(TypeError, function() {
+ C.B.methodAccess(C.B);
+}, 'accessed static private method from an arbritary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-arguments.js
new file mode 100644
index 0000000000..b915d5d642
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-ternary.template
+/*---
+description: Syntax error if `arguments` used in class field (private field, ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = true ? {} : arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-super.js
new file mode 100644
index 0000000000..c870886354
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-ternary-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-ternary.template
+/*---
+description: Syntax error if `super()` used in class field (private field, ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = true ? {} : super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-arguments.js
new file mode 100644
index 0000000000..02e7897948
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-typeof.template
+/*---
+description: Syntax error if `arguments` used in class field (private field, typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = typeof arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-super.js
new file mode 100644
index 0000000000..fe334548e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/private-typeof-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-private-typeof.template
+/*---
+description: Syntax error if `super()` used in class field (private field, typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = typeof super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-constructor.js b/js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-constructor.js
new file mode 100644
index 0000000000..5be8ca5c80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-constructor.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-getter-before-super-return-in-constructor.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private getters are installed "when super returns" and no earlier (call in constructor) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ SuperCall: super Arguments
+ 1. Let newTarget be GetNewTarget().
+ 2. If newTarget is undefined, throw a ReferenceError exception.
+ 3. Let func be ? GetSuperConstructor().
+ 4. Let argList be ArgumentListEvaluation of Arguments.
+ 5. ReturnIfAbrupt(argList).
+ 6. Let result be ? Construct(func, argList, newTarget).
+ 7. Let thisER be GetThisEnvironment( ).
+ 8. Let F be thisER.[[FunctionObject]].
+ 9. Assert: F is an ECMAScript function object.
+ 10. Perform ? InitializeInstanceElements(result, F).
+
+ EDITOR'S NOTE:
+ Private fields are added to the object one by one, interspersed with
+ evaluation of the initializers, following the construction of the
+ receiver. These semantics allow for a later initializer to refer to
+ a previous private field.
+
+---*/
+
+
+var C = class {
+ constructor() {
+ this.f();
+ }
+
+}
+
+class D extends C {
+ f() { this.#m; }
+ get #m() { return 42; }
+}
+
+assert(D.prototype.hasOwnProperty('f'));
+assert.throws(TypeError, function() {
+ var d = new D();
+}, 'private getters are not installed before super returns');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-field-initializer.js b/js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-field-initializer.js
new file mode 100644
index 0000000000..1aee1f7027
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/prod-private-getter-before-super-return-in-field-initializer.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-getter-before-super-return-in-field-initializer.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private getters are installed "when super returns" and no earlier (call in field initializer) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ SuperCall: super Arguments
+ 1. Let newTarget be GetNewTarget().
+ 2. If newTarget is undefined, throw a ReferenceError exception.
+ 3. Let func be ? GetSuperConstructor().
+ 4. Let argList be ArgumentListEvaluation of Arguments.
+ 5. ReturnIfAbrupt(argList).
+ 6. Let result be ? Construct(func, argList, newTarget).
+ 7. Let thisER be GetThisEnvironment( ).
+ 8. Let F be thisER.[[FunctionObject]].
+ 9. Assert: F is an ECMAScript function object.
+ 10. Perform ? InitializeInstanceElements(result, F).
+
+ EDITOR'S NOTE:
+ Private fields are added to the object one by one, interspersed with
+ evaluation of the initializers, following the construction of the
+ receiver. These semantics allow for a later initializer to refer to
+ a previous private field.
+
+---*/
+
+
+var C = class {
+ f = this.g();
+
+}
+
+class D extends C {
+ g() { this.#m; }
+ get #m() { return 42; }
+}
+
+assert(D.prototype.hasOwnProperty('g'));
+assert.throws(TypeError, function() {
+ var d = new D();
+}, 'private getters are not installed before super returns');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-constructor.js b/js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-constructor.js
new file mode 100644
index 0000000000..f5cdc12f0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-constructor.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-method-before-super-return-in-constructor.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private methods are installed "when super returns" and no earlier (call in constructor) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ SuperCall: super Arguments
+ 1. Let newTarget be GetNewTarget().
+ 2. If newTarget is undefined, throw a ReferenceError exception.
+ 3. Let func be ? GetSuperConstructor().
+ 4. Let argList be ArgumentListEvaluation of Arguments.
+ 5. ReturnIfAbrupt(argList).
+ 6. Let result be ? Construct(func, argList, newTarget).
+ 7. Let thisER be GetThisEnvironment( ).
+ 8. Let F be thisER.[[FunctionObject]].
+ 9. Assert: F is an ECMAScript function object.
+ 10. Perform ? InitializeInstanceElements(result, F).
+
+ EDITOR'S NOTE:
+ Private fields are added to the object one by one, interspersed with
+ evaluation of the initializers, following the construction of the
+ receiver. These semantics allow for a later initializer to refer to
+ a previous private field.
+
+---*/
+
+
+var C = class {
+ constructor() {
+ this.f();
+ }
+
+}
+
+class D extends C {
+ f() { this.#m(); }
+ #m() { return 42; }
+}
+
+assert(D.prototype.hasOwnProperty('f'));
+assert.throws(TypeError, function() {
+ var d = new D();
+}, 'private methods are not installed before super returns');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-field-initializer.js b/js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-field-initializer.js
new file mode 100644
index 0000000000..cc9b9f1d68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/prod-private-method-before-super-return-in-field-initializer.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-method-before-super-return-in-field-initializer.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private methods are installed "when super returns" and no earlier (call in field initializer) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ SuperCall: super Arguments
+ 1. Let newTarget be GetNewTarget().
+ 2. If newTarget is undefined, throw a ReferenceError exception.
+ 3. Let func be ? GetSuperConstructor().
+ 4. Let argList be ArgumentListEvaluation of Arguments.
+ 5. ReturnIfAbrupt(argList).
+ 6. Let result be ? Construct(func, argList, newTarget).
+ 7. Let thisER be GetThisEnvironment( ).
+ 8. Let F be thisER.[[FunctionObject]].
+ 9. Assert: F is an ECMAScript function object.
+ 10. Perform ? InitializeInstanceElements(result, F).
+
+ EDITOR'S NOTE:
+ Private fields are added to the object one by one, interspersed with
+ evaluation of the initializers, following the construction of the
+ receiver. These semantics allow for a later initializer to refer to
+ a previous private field.
+
+---*/
+
+
+var C = class {
+ f = this.g();
+
+}
+
+class D extends C {
+ g() { this.#m(); }
+ #m() { return 42; }
+}
+
+assert(D.prototype.hasOwnProperty('g'));
+assert.throws(TypeError, function() {
+ var d = new D();
+}, 'private methods are not installed before super returns');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-constructor.js b/js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-constructor.js
new file mode 100644
index 0000000000..33d3f07f9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-constructor.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-setter-before-super-return-in-constructor.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private setters are installed "when super returns" and no earlier (call in constructor) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ SuperCall: super Arguments
+ 1. Let newTarget be GetNewTarget().
+ 2. If newTarget is undefined, throw a ReferenceError exception.
+ 3. Let func be ? GetSuperConstructor().
+ 4. Let argList be ArgumentListEvaluation of Arguments.
+ 5. ReturnIfAbrupt(argList).
+ 6. Let result be ? Construct(func, argList, newTarget).
+ 7. Let thisER be GetThisEnvironment( ).
+ 8. Let F be thisER.[[FunctionObject]].
+ 9. Assert: F is an ECMAScript function object.
+ 10. Perform ? InitializeInstanceElements(result, F).
+
+ EDITOR'S NOTE:
+ Private fields are added to the object one by one, interspersed with
+ evaluation of the initializers, following the construction of the
+ receiver. These semantics allow for a later initializer to refer to
+ a previous private field.
+
+---*/
+
+
+var C = class {
+ constructor() {
+ this.f();
+ }
+
+}
+
+class D extends C {
+ f() { this.#m = 42; }
+ set #m(val) {}
+}
+
+assert(D.prototype.hasOwnProperty('f'));
+assert.throws(TypeError, function() {
+ var d = new D();
+}, 'private setters are not installed before super returns');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-field-initializer.js b/js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-field-initializer.js
new file mode 100644
index 0000000000..3c22cd3b9a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/prod-private-setter-before-super-return-in-field-initializer.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/prod-private-setter-before-super-return-in-field-initializer.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Private settters are installed "when super returns" and no earlier (call in field initializer) (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-public, class]
+flags: [generated]
+info: |
+ SuperCall: super Arguments
+ 1. Let newTarget be GetNewTarget().
+ 2. If newTarget is undefined, throw a ReferenceError exception.
+ 3. Let func be ? GetSuperConstructor().
+ 4. Let argList be ArgumentListEvaluation of Arguments.
+ 5. ReturnIfAbrupt(argList).
+ 6. Let result be ? Construct(func, argList, newTarget).
+ 7. Let thisER be GetThisEnvironment( ).
+ 8. Let F be thisER.[[FunctionObject]].
+ 9. Assert: F is an ECMAScript function object.
+ 10. Perform ? InitializeInstanceElements(result, F).
+
+ EDITOR'S NOTE:
+ Private fields are added to the object one by one, interspersed with
+ evaluation of the initializers, following the construction of the
+ receiver. These semantics allow for a later initializer to refer to
+ a previous private field.
+
+---*/
+
+
+var C = class {
+ f = this.g();
+
+}
+
+class D extends C {
+ g() { this.#m = 42; }
+ set #m(val) {}
+}
+
+assert(D.prototype.hasOwnProperty('g'));
+assert.throws(TypeError, function() {
+ var d = new D();
+}, 'private setters are not installed before super returns');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/redeclaration-symbol.js b/js/src/tests/test262/language/expressions/class/elements/redeclaration-symbol.js
new file mode 100644
index 0000000000..944f4f516b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/redeclaration-symbol.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/redeclaration-symbol.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Redeclaration of public fields with the same name (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js, compareArray.js]
+info: |
+ 2.13.2 Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 30. Set the value of F's [[Fields]] internal slot to fieldRecords.
+ ...
+
+ 2.14 [[Construct]] ( argumentsList, newTarget)
+
+ ...
+ 8. If kind is "base", then
+ ...
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ ...
+
+ 2.9 InitializeInstanceFields ( O, constructor )
+
+ 3. Let fieldRecords be the value of constructor's [[Fields]] internal slot.
+ 4. For each item fieldRecord in order from fieldRecords,
+ a. If fieldRecord.[[static]] is false, then
+ i. Perform ? DefineField(O, fieldRecord).
+
+---*/
+var x = [];
+var y = Symbol();
+
+
+var C = class {
+ [y] = (x.push("a"), "old_value");
+ [y] = (x.push("b"), "same_value");
+ [y] = (x.push("c"), "same_value");
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "y does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "y does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: "same_value",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert.compareArray(x, ["a", "b", "c"]);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/redeclaration.js b/js/src/tests/test262/language/expressions/class/elements/redeclaration.js
new file mode 100644
index 0000000000..16252ed8b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/redeclaration.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/redeclaration.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Redeclaration of public fields with the same name (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js, compareArray.js]
+info: |
+ 2.13.2 Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 30. Set the value of F's [[Fields]] internal slot to fieldRecords.
+ ...
+
+ 2.14 [[Construct]] ( argumentsList, newTarget)
+
+ ...
+ 8. If kind is "base", then
+ ...
+ b. Let result be InitializeInstanceFields(thisArgument, F).
+ ...
+
+ 2.9 InitializeInstanceFields ( O, constructor )
+
+ 3. Let fieldRecords be the value of constructor's [[Fields]] internal slot.
+ 4. For each item fieldRecord in order from fieldRecords,
+ a. If fieldRecord.[[static]] is false, then
+ i. Perform ? DefineField(O, fieldRecord).
+
+---*/
+var x = [];
+
+
+var C = class {
+ y = (x.push("a"), "old_value");
+ ["y"] = (x.push("b"), "another_value");
+ "y" = (x.push("c"), "same_value");
+ y = (x.push("d"), "same_value");
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "y", {
+ value: "same_value",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert.compareArray(x, ["a", "b", "c", "d"]);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-names.js
new file mode 100644
index 0000000000..d3f11136b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-names.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Computed property names (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"]
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-symbol-names.js
new file mode 100644
index 0000000000..ce73456fa5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-computed-symbol-names.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Computed property symbol names (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..a23a92fc92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: PrivateName Static Semantics, StringValue (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names-asi.js
new file mode 100644
index 0000000000..9d23581ccb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names-asi.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Literal property names with ASI (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names.js
new file mode 100644
index 0000000000..f6ac2b95be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-literal-names.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Literal property names (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-field-usage.js
new file mode 100644
index 0000000000..dc7a64eec8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-field-usage.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: PrivateName CallExpression usage (private field) (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-getter-usage.js
new file mode 100644
index 0000000000..9f8ef72f44
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-getter-usage.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-usage.js
new file mode 100644
index 0000000000..39be1bb56f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-method-usage.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: PrivateName CallExpression usage (private method) (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-names.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-names.js
new file mode 100644
index 0000000000..f46d867736
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-private-names.js
@@ -0,0 +1,57 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: private names (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..8a8084864b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier-initializer.js
@@ -0,0 +1,73 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid FieldDefinition (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier.js
new file mode 100644
index 0000000000..67360b17c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-field-identifier.js
@@ -0,0 +1,80 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid FieldDefinition (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J
+
+}
+
+var c = new C();
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter-alt.js
new file mode 100644
index 0000000000..8ad7abfbfe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter-alt.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName as private getter (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter.js
new file mode 100644
index 0000000000..45d4a9f348
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-getter.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName as private getter (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method-alt.js
new file mode 100644
index 0000000000..f33a2ac1fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method-alt.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName as private method (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method.js
new file mode 100644
index 0000000000..7241b1b01d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-method.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName as private method (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter-alt.js
new file mode 100644
index 0000000000..1bbc3c4d78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter-alt.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName as private setter (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter.js
new file mode 100644
index 0000000000..882dc1bb16
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-private-setter.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName as private setter (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..ae719bc4c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-alt.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..13758efa11
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..6724280fec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier-initializer.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier.js
new file mode 100644
index 0000000000..7975f64952
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-privatename-identifier.js
@@ -0,0 +1,95 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..2421a7d2db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..081039674a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..4135385ece
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static AsyncMethod PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..498212b253
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static AsyncMethod PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..04fe5601df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..0d9aa43ccd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,111 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..9e43861056
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static Method PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..67b0c513fd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-method-privatename-identifier.js
@@ -0,0 +1,108 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static Method PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..b1ed8b0e26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..b371efc656
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..eca6cccce0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..01539a33dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..254d488901
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..c75c9daeea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..047f372bd9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-rs-static-privatename-identifier.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: Valid Static PrivateName (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-fields.js
new file mode 100644
index 0000000000..54705d929d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-fields.js
@@ -0,0 +1,57 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: static private fields (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..088cf25cd6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods-with-fields.js
@@ -0,0 +1,74 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: static private methods with fields (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods.js
new file mode 100644
index 0000000000..013a37475f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-static-private-methods.js
@@ -0,0 +1,61 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: static private methods (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/regular-definitions-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-string-literal-names.js
new file mode 100644
index 0000000000..b31912d2e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/regular-definitions-string-literal-names.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-regular-definitions.template
+/*---
+description: String literal names (regular fields defintion)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-names.js
new file mode 100644
index 0000000000..4906c6e0df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-names.js
@@ -0,0 +1,120 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Computed property names (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-symbol-names.js
new file mode 100644
index 0000000000..2ac0e14231
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-computed-symbol-names.js
@@ -0,0 +1,118 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Computed property symbol names (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ async *m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+ );
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..2d100c9cc0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.o(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names-asi.js
new file mode 100644
index 0000000000..aa944b8708
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names-asi.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Literal property names with ASI (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names.js
new file mode 100644
index 0000000000..4e881c4ec4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-literal-names.js
@@ -0,0 +1,109 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Literal property names (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ async *m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-field-usage.js
new file mode 100644
index 0000000000..f57927115b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-field-usage.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-getter-usage.js
new file mode 100644
index 0000000000..4f47a7cad1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-getter-usage.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-usage.js
new file mode 100644
index 0000000000..a62f5195b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-method-usage.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-names.js
new file mode 100644
index 0000000000..46ed1e5956
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-private-names.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: private names (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(c.x(), 42, "test 7");
+ assert.sameValue(c.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..0c79f9abeb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier-initializer.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier.js
new file mode 100644
index 0000000000..5b69a3868b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-field-identifier.js
@@ -0,0 +1,107 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid FieldDefinition (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ c.$ = 1;
+ c._ = 1;
+ c.\u{6F} = 1;
+ c.\u2118 = 1;
+ c.ZW_\u200C_NJ = 1;
+ c.ZW_\u200D_J = 1;
+
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter-alt.js
new file mode 100644
index 0000000000..534e834ab6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter-alt.js
@@ -0,0 +1,141 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter.js
new file mode 100644
index 0000000000..d5823bb40b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-getter.js
@@ -0,0 +1,141 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName as private getter (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method-alt.js
new file mode 100644
index 0000000000..998edfbb0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method-alt.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method.js
new file mode 100644
index 0000000000..6e62cd0029
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-method.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName as private method (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter-alt.js
new file mode 100644
index 0000000000..7133ed9249
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter-alt.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter.js
new file mode 100644
index 0000000000..cc197bef58
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-private-setter.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName as private setter (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..e27507ea1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..f20dc121da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,116 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.℘(), 1);
+ assert.sameValue(c.ZW_‌_NJ(), 1);
+ assert.sameValue(c.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..12366fa718
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier-initializer.js
@@ -0,0 +1,116 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.\u2118(), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(), 1);
+ assert.sameValue(c.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier.js
new file mode 100644
index 0000000000..ce54c9e41b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-privatename-identifier.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..3d14a13072
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,148 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..974462cf3f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,149 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..a8991eecd2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,148 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..475a3480ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,149 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..c0a724a5fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.o([1]).next().value, 1);
+ assert.sameValue(C.℘([1]).next().value, 1);
+ assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..ce286f3c9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,138 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.\u{6F}([1]).next().value, 1);
+ assert.sameValue(C.\u2118([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..21f6de7543
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..bf3332a78d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static Method PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..51975be248
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..945b821a9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..764f5bd1d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..f646ab6484
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..0a80aed713
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..2bc10ad56f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.\u2118(), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(), 1);
+ assert.sameValue(C.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..d0d6c71146
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-rs-static-privatename-identifier.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: Valid Static PrivateName (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-fields.js
new file mode 100644
index 0000000000..5666f18381
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-fields.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: static private fields (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..3c528312ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods-with-fields.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: static private methods with fields (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 13");
+ assert.sameValue(C.y(), 43, "test 14");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods.js
new file mode 100644
index 0000000000..412933c6a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-static-private-methods.js
@@ -0,0 +1,88 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: static private methods (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 86, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-string-literal-names.js
new file mode 100644
index 0000000000..67ba82343c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-gen-string-literal-names.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-gen.template
+/*---
+description: String literal names (field definitions after an async generator in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-iteration]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ async *m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().next().then(function(v) {
+ assert.sameValue(v.value, 42);
+ assert.sameValue(v.done, true);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-names.js
new file mode 100644
index 0000000000..ec033fb4e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-names.js
@@ -0,0 +1,119 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Computed property names (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"];
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-symbol-names.js
new file mode 100644
index 0000000000..277d374c92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-computed-symbol-names.js
@@ -0,0 +1,117 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Computed property symbol names (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ async m() { return 42; } [x]; [y] = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+ );
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+ );
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..d50aefe3f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.o(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names-asi.js
new file mode 100644
index 0000000000..1fc9e01de7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names-asi.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Literal property names with ASI (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } a
+ b = 42;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names.js
new file mode 100644
index 0000000000..a385c592a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-literal-names.js
@@ -0,0 +1,108 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Literal property names (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ async m() { return 42; } a; b = 42;
+ c = fn;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-field-usage.js
new file mode 100644
index 0000000000..55a1755662
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-field-usage.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #m = 'test262';;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..b97667936f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-getter-usage.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } get #m() { return 'test262'; };
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-usage.js
new file mode 100644
index 0000000000..82264063a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-method-usage.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #m() { return 'test262'; };
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.method(), 'test262');
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-names.js
new file mode 100644
index 0000000000..763444c560
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-private-names.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: private names (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #x; #y;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(c.x(), 42, "test 7");
+ assert.sameValue(c.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..be62bd1433
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier-initializer.js
@@ -0,0 +1,99 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid FieldDefinition (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier.js
new file mode 100644
index 0000000000..bbe230964e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-field-identifier.js
@@ -0,0 +1,106 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid FieldDefinition (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ c.$ = 1;
+ c._ = 1;
+ c.\u{6F} = 1;
+ c.\u2118 = 1;
+ c.ZW_\u200C_NJ = 1;
+ c.ZW_\u200D_J = 1;
+
+ assert.sameValue(c.$, 1);
+ assert.sameValue(c._, 1);
+ assert.sameValue(c.\u{6F}, 1);
+ assert.sameValue(c.\u2118, 1);
+ assert.sameValue(c.ZW_\u200C_NJ, 1);
+ assert.sameValue(c.ZW_\u200D_J, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..67979cb64e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter-alt.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter.js
new file mode 100644
index 0000000000..5d50b39e54
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-getter.js
@@ -0,0 +1,140 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..2dd36a8b7f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method-alt.js
@@ -0,0 +1,139 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method.js
new file mode 100644
index 0000000000..da4af1f152
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-method.js
@@ -0,0 +1,139 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName as private method (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..108fa47573
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter-alt.js
@@ -0,0 +1,139 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter.js
new file mode 100644
index 0000000000..7cdc52b139
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-private-setter.js
@@ -0,0 +1,139 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..1e7081b352
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.℘(1), 1);
+ assert.sameValue(c.ZW_‌_NJ(1), 1);
+ assert.sameValue(c.ZW_‍_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..561da54683
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,115 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.℘(), 1);
+ assert.sameValue(c.ZW_‌_NJ(), 1);
+ assert.sameValue(c.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..3d69ae4be9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,115 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(), 1);
+ assert.sameValue(c._(), 1);
+ assert.sameValue(c.\u{6F}(), 1);
+ assert.sameValue(c.\u2118(), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(), 1);
+ assert.sameValue(c.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..a08dfc6949
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-privatename-identifier.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(c.$(1), 1);
+ assert.sameValue(c._(1), 1);
+ assert.sameValue(c.\u{6F}(1), 1);
+ assert.sameValue(c.\u2118(1), 1);
+ assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..aae6fa75a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,147 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..7e36569bf9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,148 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+ ]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..021435f839
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,147 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..5e2785b2fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,148 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+ ]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+ }).then($DONE, $DONE);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..994eb5a4d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,136 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.o([1]).next().value, 1);
+ assert.sameValue(C.℘([1]).next().value, 1);
+ assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..86a9fcba39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,137 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$([1]).next().value, 1);
+ assert.sameValue(C._([1]).next().value, 1);
+ assert.sameValue(C.\u{6F}([1]).next().value, 1);
+ assert.sameValue(C.\u2118([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+ assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..2b2a322abf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..19a38a4723
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..b17a1f1fa0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..572825c0eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.o(1), 1);
+ assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+ assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..75e1003a46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..770fc00d75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,116 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..ed6152e631
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,116 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.℘(), 1);
+ assert.sameValue(C.ZW_‌_NJ(), 1);
+ assert.sameValue(C.ZW_‍_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..ca15b7216d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,116 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(), 1);
+ assert.sameValue(C._(), 1);
+ assert.sameValue(C.\u{6F}(), 1);
+ assert.sameValue(C.\u2118(), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(), 1);
+ assert.sameValue(C.ZW_\u200D_J(), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..327a92ac36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-rs-static-privatename-identifier.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: Valid Static PrivateName (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert.sameValue(C.$(1), 1);
+ assert.sameValue(C._(1), 1);
+ assert.sameValue(C.\u{6F}(1), 1);
+ assert.sameValue(C.\u2118(1), 1);
+ assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+ assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-fields.js
new file mode 100644
index 0000000000..270bcfdfd6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-fields.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: static private fields (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #x; static #y;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private fields do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 43, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..0ece7a2e7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods-with-fields.js
@@ -0,0 +1,100 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: static private methods with fields (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } static #xVal; static #yVal;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 13");
+ assert.sameValue(C.y(), 43, "test 14");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+ assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods.js
new file mode 100644
index 0000000000..0c40f448f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-static-private-methods.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: static private methods (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } ;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ // Test the private methods do not appear as properties before set to value
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+ assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+ assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+ // Test if private fields can be sucessfully accessed and set to value
+ assert.sameValue(C.x(), 42, "test 7");
+ assert.sameValue(C.y(), 86, "test 8");
+
+ // Test the private fields do not appear as properties before after set to value
+ assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+ assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-string-literal-names.js
new file mode 100644
index 0000000000..dbc9ddd287
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-async-method-string-literal-names.js
@@ -0,0 +1,121 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-after-same-line-async-method.template
+/*---
+description: String literal names (field definitions after an async method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, async-functions]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ async m() { return 42; } 'a'; "b"; 'c' = 39;
+ "d" = 42;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+assert.sameValue(c.m, C.prototype.m);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+}, {restore: true});
+
+c.m().then(function(v) {
+ assert.sameValue(v, 42);
+
+ function assertions() {
+ // Cover $DONE handler for async cases.
+ function $DONE(error) {
+ if (error) {
+ throw new Test262Error('Test262:AsyncTestFailure')
+ }
+ }
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+
+ assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+ );
+ assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+ );
+
+ verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ }
+
+ return Promise.resolve(assertions());
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-names.js
new file mode 100644
index 0000000000..505ee57ef1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-names.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Computed property names (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-symbol-names.js
new file mode 100644
index 0000000000..c0514b435e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-computed-symbol-names.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Computed property symbol names (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..4eec1dc002
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;; *m() { return 42; }
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names-asi.js
new file mode 100644
index 0000000000..2ced1f2a3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names-asi.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Literal property names with ASI (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names.js
new file mode 100644
index 0000000000..5c188a3424
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-literal-names.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Literal property names (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-field-usage.js
new file mode 100644
index 0000000000..c48979d270
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-field-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';; *m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-getter-usage.js
new file mode 100644
index 0000000000..97229e27ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-getter-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; }; *m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-usage.js
new file mode 100644
index 0000000000..1fb15718ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-method-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }; *m() { return 42; }
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-names.js
new file mode 100644
index 0000000000..2adf1a4259
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-private-names.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: private names (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y; *m() { return 42; }
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..b8a658610b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier-initializer.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier.js
new file mode 100644
index 0000000000..3e4b04d54f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-field-identifier.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter-alt.js
new file mode 100644
index 0000000000..0ae00bfa2f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+; *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter.js
new file mode 100644
index 0000000000..c6d6193d04
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-getter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+; *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method-alt.js
new file mode 100644
index 0000000000..7531e55145
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+; *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method.js
new file mode 100644
index 0000000000..8dd575ec65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-method.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+; *m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter-alt.js
new file mode 100644
index 0000000000..822abac715
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+; *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter.js
new file mode 100644
index 0000000000..baa31196f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-private-setter.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+; *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..435d468b2b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-alt.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..6456b3a6fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; *m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..139d4b0db3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier-initializer.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; *m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier.js
new file mode 100644
index 0000000000..2c2da12ca3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-privatename-identifier.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; *m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..2fca316f72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ }; *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..fa488d35ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ }; *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..771b31a0ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ }; *m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..133f94a76e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ }; *m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..bc62f6125a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,124 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ }; *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..966d59cc70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ }; *m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..da401f652f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ }; *m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..39fddc3ca8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-method-privatename-identifier.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ }; *m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..f2096525d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..b2e1b3cb78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..ee8dff4164
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..d2198dc372
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; }
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..bbe8f2eb4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..6f9fc046a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; *m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..ca74e9bdb1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-rs-static-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-fields.js
new file mode 100644
index 0000000000..1edff1e4db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-fields.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: static private fields (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y; *m() { return 42; }
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..ec5226b721
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods-with-fields.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: static private methods with fields (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal; *m() { return 42; }
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods.js
new file mode 100644
index 0000000000..90882d6c68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-static-private-methods.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: static private methods (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ; *m() { return 42; }
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-gen-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-string-literal-names.js
new file mode 100644
index 0000000000..f884246980
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-gen-string-literal-names.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-same-line-generator.template
+/*---
+description: String literal names (field definitions followed by a generator method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class, generators]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42; *m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m().next().value, 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-names.js
new file mode 100644
index 0000000000..693ec20545
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-names.js
@@ -0,0 +1,107 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Computed property names (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-symbol-names.js
new file mode 100644
index 0000000000..b1fc5657be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-computed-symbol-names.js
@@ -0,0 +1,105 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Computed property symbol names (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ [x]; [y] = 42; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..c1198f645d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: PrivateName Static Semantics, StringValue (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;; m() { return 42; }
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names-asi.js
new file mode 100644
index 0000000000..c102852792
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names-asi.js
@@ -0,0 +1,77 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Literal property names with ASI (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ a
+ b = 42;; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names.js
new file mode 100644
index 0000000000..ec0fbadf3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-literal-names.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Literal property names (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ a; b = 42;
+ c = fn; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-field-usage.js
new file mode 100644
index 0000000000..db8a8fa945
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-field-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: PrivateName CallExpression usage (private field) (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m = 'test262';; m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-getter-usage.js
new file mode 100644
index 0000000000..7cbb6bdfbb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-getter-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ get #m() { return 'test262'; }; m() { return 42; }
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-usage.js
new file mode 100644
index 0000000000..df1c02e666
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-method-usage.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: PrivateName CallExpression usage (private method) (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ #m() { return 'test262'; }; m() { return 42; }
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-names.js
new file mode 100644
index 0000000000..5bb37c52f4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-private-names.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: private names (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x; #y; m() { return 42; }
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..7762942137
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier-initializer.js
@@ -0,0 +1,87 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier.js
new file mode 100644
index 0000000000..25157c800b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-field-identifier.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid FieldDefinition (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter-alt.js
new file mode 100644
index 0000000000..b0b0cebcf1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter-alt.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+; m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter.js
new file mode 100644
index 0000000000..f1327c5cd5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-getter.js
@@ -0,0 +1,128 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName as private getter (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+; m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method-alt.js
new file mode 100644
index 0000000000..5b4f76a664
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+; m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method.js
new file mode 100644
index 0000000000..6889fa9064
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-method.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName as private method (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+; m() { return 42; }
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter-alt.js
new file mode 100644
index 0000000000..fe71360305
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter-alt.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+; m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter.js
new file mode 100644
index 0000000000..b270bcaec3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-private-setter.js
@@ -0,0 +1,127 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName as private setter (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+; m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..1d5bbb7f56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-alt.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..0e1295cd59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..512657752c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier-initializer.js
@@ -0,0 +1,103 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; m() { return 42; }
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier.js
new file mode 100644
index 0000000000..9494d5d32e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-privatename-identifier.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; m() { return 42; }
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..891a512dee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ }; m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..3104f35c04
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ }; m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..cb1f017454
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,134 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ }; m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..bce016a35a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,135 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ }; m() { return 42; }
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..19a5836aea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,124 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ }; m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..bc49c840ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,125 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ }; m() { return 42; }
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..4bc5d2304e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ }; m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..cff93deb37
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-method-privatename-identifier.js
@@ -0,0 +1,122 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static Method PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ }; m() { return 42; }
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..c0500f56df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..3f9e70065f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..956e45f90c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; }
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..27e8892058
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; }
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..5cb8e9016c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..d10387e6a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,104 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; m() { return 42; }
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..af9366ea26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-rs-static-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: Valid Static PrivateName (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; }
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-fields.js
new file mode 100644
index 0000000000..123913e246
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-fields.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: static private fields (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #x; static #y; m() { return 42; }
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..d321144db3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods-with-fields.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: static private methods with fields (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ static #xVal; static #yVal; m() { return 42; }
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods.js
new file mode 100644
index 0000000000..adce1e3c6c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-static-private-methods.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: static private methods (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ; m() { return 42; }
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/same-line-method-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/same-line-method-string-literal-names.js
new file mode 100644
index 0000000000..51f6b01863
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/same-line-method-string-literal-names.js
@@ -0,0 +1,109 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-same-line-method.template
+/*---
+description: String literal names (field definitions followed by a method in the same line)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ 'a'; "b"; 'c' = 39;
+ "d" = 42; m() { return 42; }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.m(), 42);
+assert.sameValue(c.m, C.prototype.m);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "m"),
+ "m doesn't appear as an own property on the C instance"
+);
+
+verifyProperty(C.prototype, "m", {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/shell.js b/js/src/tests/test262/language/expressions/class/elements/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field-assigned.js b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field-assigned.js
new file mode 100644
index 0000000000..208b48a8db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field-assigned.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-as-valid-instance-field-assigned.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static is a valid name of an instance field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static = "foo";
+}
+
+let c = new C();
+
+verifyProperty(c, "static", {
+ value: "foo",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field.js b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field.js
new file mode 100644
index 0000000000..8a548867c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-instance-field.js
@@ -0,0 +1,38 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-as-valid-instance-field.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static is a valid name of an instance field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ static;
+}
+
+let c = new C();
+
+verifyProperty(c, "static", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field-assigned.js b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field-assigned.js
new file mode 100644
index 0000000000..808acee9c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field-assigned.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-as-valid-static-field-assigned.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static is a valid name of a static field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ static FieldDefinition ;
+
+---*/
+
+
+var C = class {
+ static static = "test262";
+}
+
+verifyProperty(C, "static", {
+ value: "test262",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field.js b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field.js
new file mode 100644
index 0000000000..a275a57f5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-as-valid-static-field.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-as-valid-static-field.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static is a valid name of a static field (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ static FieldDefinition ;
+
+---*/
+
+
+var C = class {
+ static static;
+}
+
+verifyProperty(C, "static", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..bec5785549
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-arguments.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-comp-name.template
+/*---
+description: Syntax error if `arguments` used in class field (static computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public, computed-property-names]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ static [x] = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-super.js
new file mode 100644
index 0000000000..0e4f6b1a29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-comp-name-init-err-contains-super.js
@@ -0,0 +1,29 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-comp-name.template
+/*---
+description: Syntax error if `super()` used in class field (static computed ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public, computed-property-names]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var x = "string";
+var C = class {
+ static [x] = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-length.js b/js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-length.js
new file mode 100644
index 0000000000..aad0b7fb88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-length.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-field-anonymous-function-length.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Anonymous function in field initilizer have length properly set (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ ...
+
+---*/
+
+
+var C = class {
+ static #field = (a, b) => undefined;
+ static field = function() {};
+
+ static accessPrivateField() {
+ return this.#field;
+ }
+
+}
+
+assert.sameValue(C.accessPrivateField().length, 2);
+assert.sameValue(C.field.length, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-name.js b/js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-name.js
new file mode 100644
index 0000000000..03c41ea274
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-field-anonymous-function-name.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-field-anonymous-function-name.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Anonymous function receives the name of static fields (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ 6. Else, let initValue be undefined.
+ 7. If fieldRecord.[[IsAnonymousFunctionDefinition]] is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(initValue, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(initValue, fieldName).
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+ 9. Else,
+ a. Assert: IsPropertyKey(fieldName) is true.
+ b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue).
+ 10. Return.
+
+---*/
+
+
+var C = class {
+ static #field = () => 'Test262';
+ static field = function() { return 42; };
+
+ static accessPrivateField() {
+ return this.#field;
+ }
+
+}
+
+assert.sameValue(C.accessPrivateField().name, "#field");
+assert.sameValue(C.field.name, "field");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-field-declaration.js b/js/src/tests/test262/language/expressions/class/elements/static-field-declaration.js
new file mode 100644
index 0000000000..66d4e14e6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-field-declaration.js
@@ -0,0 +1,132 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-field-declaration.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static fields are defined using DefineField (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for mClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ 6. Else, let initValue be undefined.
+ 7. If fieldRecord.[[IsAnonymousFunctionDefinition]] is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(initValue, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(initValue, fieldName).
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+ 9. Else,
+ a. Assert: IsPropertyKey(fieldName) is true.
+ b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue).
+ 10. Return.
+
+---*/
+var computed = 'h';
+
+
+var C = class {
+ static f = 'test262';
+ static 'g';
+ static 0 = 'bar';
+ static [computed];
+}
+
+let c = new C();
+
+assert.sameValue(c.f, undefined);
+assert.sameValue(c.g, undefined);
+assert.sameValue(c.h, undefined);
+assert.sameValue(c[0], undefined);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(c, 'f'),
+ "f does not appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, 'g'),
+ "g does not appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, 'h'),
+ "h does not appear as an own property on the C instance"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, 0),
+ "0 does not appear as an own property on the C instance"
+);
+
+verifyProperty(C, 'f', {
+ value: 'test262',
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(C, 'g', {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(C, 0, {
+ value: 'bar',
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+verifyProperty(C, 'h', {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-field-init-this-inside-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/static-field-init-this-inside-arrow-function.js
new file mode 100644
index 0000000000..d3cf3824e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-field-init-this-inside-arrow-function.js
@@ -0,0 +1,65 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-field-init-this-inside-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: this in static field initializers refers to class constructor (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ 6. Else, let initValue be undefined.
+ 7. If fieldRecord.[[IsAnonymousFunctionDefinition]] is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(initValue, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(initValue, fieldName).
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+ 9. Else,
+ a. Assert: IsPropertyKey(fieldName) is true.
+ b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue).
+ 10. Return.
+
+---*/
+
+
+var C = class {
+ static f = () => this;
+}
+
+assert.sameValue(C.f(), C);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-field-init-with-this.js b/js/src/tests/test262/language/expressions/class/elements/static-field-init-with-this.js
new file mode 100644
index 0000000000..114006ab54
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-field-init-with-this.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-field-init-with-this.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static fields initializer has `this` biding (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ 6. Else, let initValue be undefined.
+ 7. If fieldRecord.[[IsAnonymousFunctionDefinition]] is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(initValue, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(initValue, fieldName).
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+ 9. Else,
+ a. Assert: IsPropertyKey(fieldName) is true.
+ b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue).
+ 10. Return.
+
+---*/
+
+
+var C = class {
+ static f = 'test';
+ static g = this.f + '262';
+ static h = eval('this.g') + 'test';
+}
+
+assert.sameValue(C.f, 'test');
+assert.sameValue(C.g, 'test262');
+assert.sameValue(C.h, 'test262test');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-field-redeclaration.js b/js/src/tests/test262/language/expressions/class/elements/static-field-redeclaration.js
new file mode 100644
index 0000000000..2318f50f20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-field-redeclaration.js
@@ -0,0 +1,71 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-field-redeclaration.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static fields can be redeclared (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-fields-public, class]
+flags: [generated]
+info: |
+ Updated Productions
+
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassDefinitionEvaluation:
+ ...
+
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ 1. Assert: Type(receiver) is Object.
+ 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation.
+ 3. Let name be fieldRecord.[[Name]].
+ 4. Let initializer be fieldRecord.[[Initializer]].
+ 5. If initializer is not empty, then
+ a. Let initValue be ? Call(initializer, receiver).
+ 6. Else, let initValue be undefined.
+ 7. If fieldRecord.[[IsAnonymousFunctionDefinition]] is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(initValue, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(initValue, fieldName).
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+ 9. Else,
+ a. Assert: IsPropertyKey(fieldName) is true.
+ b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue).
+ 10. Return.
+
+---*/
+
+
+var C = class {
+ static f = 'test';
+ static f = this.f + '262';
+ static g() {
+ return 45;
+ };
+ static g = this.g();
+}
+
+assert.sameValue(C.f, 'test262');
+assert.sameValue(C.g, 45);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-arguments.js
new file mode 100644
index 0000000000..2b32142f7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-literal-name.template
+/*---
+description: Syntax error if `arguments` used in class field (static literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static x = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-super.js
new file mode 100644
index 0000000000..2d0ac810c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-literal-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-literal-name.template
+/*---
+description: Syntax error if `super()` used in class field (static literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static x = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-fields-proxy-default-handler-throws.js b/js/src/tests/test262/language/expressions/class/elements/static-private-fields-proxy-default-handler-throws.js
new file mode 100644
index 0000000000..98804c5112
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-fields-proxy-default-handler-throws.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-privatefieldget
+description: Static private fields not accessible via default Proxy handler
+info: |
+ 1. Assert: P is a Private Name value.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. Let entry be PrivateFieldFind(P, O).
+ 4. If entry is empty, throw a TypeError exception.
+
+features: [class, class-static-fields-private]
+---*/
+
+var C = class {
+ static #x = 1;
+ static x() {
+ return this.#x;
+ }
+}
+
+var P = new Proxy(C, {});
+
+assert.sameValue(C.x(), 1);
+assert.throws(TypeError, function() {
+ P.x();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..48163c85a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-arrow-function.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-getter-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private getter access inside of an arrow function (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static get #f() {
+ return 'Test262';
+ }
+
+ static access() {
+ const arrowFunction = () => {
+ return this.#f;
+ };
+
+ return arrowFunction();
+ }
+}
+
+assert.sameValue(C.access(), 'Test262');
+assert.throws(TypeError, function() {
+ C.access.call({});
+}, 'Accessed static private getter from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-class.js b/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-class.js
new file mode 100644
index 0000000000..a7e255707c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-class.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-getter-access-on-inner-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private getter access inside of an inner class (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static get #f() {
+ return 'Test262';
+ }
+
+ static Inner = class {
+ static access(o) {
+ return o.#f;
+ }
+ }
+}
+
+assert.sameValue(C.Inner.access(C), 'Test262');
+assert.throws(TypeError, function() {
+ C.Inner.access(C.Inner);
+}, 'Accessed static private getter from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-function.js
new file mode 100644
index 0000000000..1b1777cfe9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-getter-access-on-inner-function.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-getter-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private getter access inside of a nested function (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static get #f() {
+ return 'Test262';
+ }
+
+ static access() {
+ const self = this;
+
+ function innerFunction() {
+ return self.#f;
+ }
+
+ return innerFunction();
+ }
+}
+
+assert.sameValue(C.access(), 'Test262');
+assert.throws(TypeError, function() {
+ C.access.call({});
+}, 'Accessed static private getter from an arbitrary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/static-private-getter.js
new file mode 100644
index 0000000000..25978821f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-getter.js
@@ -0,0 +1,57 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-getter.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private getter declaration and usage (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ ...
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static get #f() {
+ return 'Test262';
+ }
+
+ static access() {
+ return this.#f;
+ }
+}
+
+assert.sameValue(C.access(), 'Test262');
+assert.throws(TypeError, function() {
+ C.access.call({});
+}, 'Accessed static private getter from an arbitrary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-arguments.js
new file mode 100644
index 0000000000..17c826b759
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-private-name.template
+/*---
+description: Syntax error if `arguments` used in class field (static PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #x = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-super.js
new file mode 100644
index 0000000000..496b781e99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-private-name.template
+/*---
+description: Syntax error if `super()` used in class field (static PrivateName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #x = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..5bdd4b00b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-arrow-function.js
@@ -0,0 +1,44 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-method-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static private method access inside of an arrow function (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static #f() { return 42; }
+ static g() {
+ const arrowFunction = () => {
+ return this.#f();
+ };
+
+ return arrowFunction();
+ }
+
+}
+
+assert.sameValue(C.g(), 42);
+assert.throws(TypeError, function() {
+ C.g.call({});
+}, 'Accessed static private method from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-function.js
new file mode 100644
index 0000000000..6d7294d36d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-method-access-on-inner-function.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-method-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static private method access inside of a nested function (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static #f() { return 42; }
+ static g() {
+ const self = this;
+
+ function innerFunction() {
+ return self.#f();
+ }
+
+ return innerFunction();
+ }
+
+}
+
+assert.sameValue(C.g(), 42);
+assert.throws(TypeError, function() {
+ C.g.call({});
+}, 'Accessed static private method from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-method-and-instance-method-brand-check.js b/js/src/tests/test262/language/expressions/class/elements/static-private-method-and-instance-method-brand-check.js
new file mode 100644
index 0000000000..b43b02a11b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-method-and-instance-method-brand-check.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-method-and-instance-method-brand-check.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Brand for static private names and instance private names are different (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-methods-private, class]
+flags: [generated]
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 32. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] field is proto,
+ a. Set F.[[PrivateBrand]] to proto.
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static #f() {
+ return 'static';
+ }
+
+ static access() {
+ return this.#f();
+ }
+
+ #instanceMethod() {
+ return 'instance';
+ }
+
+ instanceAccess() {
+ return this.#instanceMethod();
+ }
+}
+
+let c = new C();
+assert.sameValue(C.access(), 'static');
+assert.sameValue(c.instanceAccess(), 'instance');
+
+assert.throws(TypeError, function() {
+ C.access.call(c);
+}, 'Accessed static private method from instance of C');
+
+assert.throws(TypeError, function() {
+ c.instanceAccess.call(C);
+}, 'Accessed instance private method from C');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-method-referenced-from-instance-method.js b/js/src/tests/test262/language/expressions/class/elements/static-private-method-referenced-from-instance-method.js
new file mode 100644
index 0000000000..8a67cd8e0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-method-referenced-from-instance-method.js
@@ -0,0 +1,40 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-method-referenced-from-instance-method.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static private method referenced from an instance method (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static #f() { return 42; }
+ g() {
+ return this.#f();
+ }
+
+}
+
+assert.sameValue(new C().g.call(C), 42);
+assert.throws(TypeError, function() {
+ new C().g();
+}, 'Accessed static private method from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-method-subclass-receiver.js b/js/src/tests/test262/language/expressions/class/elements/static-private-method-subclass-receiver.js
new file mode 100644
index 0000000000..59709c19fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-method-subclass-receiver.js
@@ -0,0 +1,39 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-method-subclass-receiver.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: Static private methods on the super-class cannot be called with sub-class as the receiver (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static f() { return this.#g(); }
+ static #g() { return 42; }
+
+}
+
+class D extends C {}
+assert.sameValue(C.f(), 42);
+assert.throws(TypeError, function() {
+ D.f();
+}, 'D does not contain static private method #g');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-methods-proxy-default-handler-throws.js b/js/src/tests/test262/language/expressions/class/elements/static-private-methods-proxy-default-handler-throws.js
new file mode 100644
index 0000000000..b1add84534
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-methods-proxy-default-handler-throws.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-privatefieldget
+description: Static private methods not accessible via default Proxy handler
+info: |
+ 1. Assert: P is a Private Name value.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. Let entry be PrivateFieldFind(P, O).
+ 4. If entry is empty, throw a TypeError exception.
+
+features: [class, class-static-methods-private]
+---*/
+
+
+var C = class {
+ static #x(value) {
+ return 1;
+ }
+ static x() {
+ return this.#x();
+ }
+}
+
+var P = new Proxy(C, {});
+
+assert.sameValue(C.x(), 1);
+assert.throws(TypeError, function() {
+ P.x();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-arrow-function.js b/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-arrow-function.js
new file mode 100644
index 0000000000..99ff6c1a22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-arrow-function.js
@@ -0,0 +1,47 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-setter-access-on-inner-arrow-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private setter access inside of an arrow function (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static set #f(v) {
+ this._v = v;
+ }
+
+ static access() {
+ const arrowFunction = () => {
+ this.#f = 'Test262';
+ };
+
+ arrowFunction();
+ }
+}
+
+C.access();
+assert.sameValue(C._v, 'Test262');
+assert.throws(TypeError, function() {
+ C.access.call({});
+}, 'Accessed static private setter from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-class.js b/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-class.js
new file mode 100644
index 0000000000..902991199d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-class.js
@@ -0,0 +1,46 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-setter-access-on-inner-class.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private setter access inside of an inner class (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-public, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static set #f(v) {
+ return this._v = v;
+ }
+
+ static Inner = class {
+ static access(o) {
+ o.#f = 'Test262';
+ }
+ }
+
+}
+
+C.Inner.access(C)
+assert.sameValue(C._v, 'Test262');
+assert.throws(TypeError, function() {
+ C.Inner.access(C.Inner);
+}, 'Accessed static private setter from an object which did not contain it');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-function.js b/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-function.js
new file mode 100644
index 0000000000..c9fae6a871
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-setter-access-on-inner-function.js
@@ -0,0 +1,49 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-setter-access-on-inner-function.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private setter access inside of a nested function (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ a. Return P.[[Value]].
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static set #f(v) {
+ this._v = v;
+ }
+
+ static access() {
+ const self = this;
+
+ function innerFunction() {
+ self.#f = 'Test262';
+ }
+
+ innerFunction();
+ }
+}
+
+C.access();
+assert.sameValue(C._v, 'Test262');
+assert.throws(TypeError, function() {
+ C.access.call({});
+}, 'Accessed static private setter from an arbitrary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/static-private-setter.js
new file mode 100644
index 0000000000..a53347934e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-private-setter.js
@@ -0,0 +1,58 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-setter.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: static private setter declaration and usage (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ MethodDefinition :
+ get ClassElementName () { FunctionBody }
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+
+ PrivateFieldGet (P, O)
+ 1. Assert: P is a Private Name.
+ 2. If O is not an object, throw a TypeError exception.
+ 3. If P.[[Kind]] is "field",
+ ...
+ 4. Perform ? PrivateBrandCheck(O, P).
+ 5. If P.[[Kind]] is "method",
+ ...
+ 6. Else,
+ a. Assert: P.[[Kind]] is "accessor".
+ b. If P does not have a [[Get]] field, throw a TypeError exception.
+ c. Let getter be P.[[Get]].
+ d. Return ? Call(getter, O).
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+
+---*/
+
+
+var C = class {
+ static set #f(v) {
+ this._v = v;
+ }
+
+ static access() {
+ this.#f = 'Test262';
+ }
+}
+
+C.access();
+assert.sameValue(C._v, 'Test262');
+assert.throws(TypeError, function() {
+ C.access.call({});
+}, 'Accessed static private setter from an arbitrary object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..c2e0110350
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-string-literal-name.template
+/*---
+description: Syntax error if `arguments` used in class field (static string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static 'x' = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..daa30b0d65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/static-string-literal-name-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-static-string-literal-name.template
+/*---
+description: Syntax error if `super()` used in class field (static string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public, class-static-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static 'x' = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-arguments.js
new file mode 100644
index 0000000000..2256c69eda
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-string-literal-name.template
+/*---
+description: Syntax error if `arguments` used in class field (string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ 'x' = arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-super.js
new file mode 100644
index 0000000000..c4e66fee60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/string-literal-name-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-string-literal-name.template
+/*---
+description: Syntax error if `super()` used in class field (string literal ClassElementName)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ 'x' = super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/super-access-from-arrow-func-on-field.js b/js/src/tests/test262/language/expressions/class/elements/super-access-from-arrow-func-on-field.js
new file mode 100644
index 0000000000..df472c3c64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/super-access-from-arrow-func-on-field.js
@@ -0,0 +1,39 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/super-access-from-arrow-func-on-field.case
+// - src/class-elements/default/cls-expr.template
+/*---
+description: super inside arrow functions on field initializer resolves to class' super (field definitions in a class expression)
+esid: prod-FieldDefinition
+features: [class-fields-public, class-static-fields-public, class]
+flags: [generated]
+info: |
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ SuperProperty:
+ super[Expression]
+ super.IdentifierName
+
+---*/
+
+
+var C = class {
+ func = () => {
+ super.prop = 'test262';
+ }
+
+ static staticFunc = () => {
+ super.staticProp = 'static test262';
+ }
+}
+
+let c = new C();
+c.func();
+assert.sameValue(c.prop, 'test262');
+
+C.staticFunc();
+assert.sameValue(C.staticProp, 'static test262');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/browser.js b/js/src/tests/test262/language/expressions/class/elements/syntax/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/browser.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js
new file mode 100644
index 0000000000..82db7c4134
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/class-heritage-array-literal-arrow-heritage.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name. (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+
+ ClassHeritage :
+ extends LeftHandSideExpression
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends () => {} {
+
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js
new file mode 100644
index 0000000000..bc9e9e4f0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/class-heritage-array-literal-async-arrow-heritage.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name. (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+
+ ClassHeritage :
+ extends LeftHandSideExpression
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends async () => {} {
+
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/browser.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..b2512ecd2a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class-fields-public, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..798847cd9e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-methods-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..c9b511f5b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js
new file mode 100644
index 0000000000..8508851470
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js
new file mode 100644
index 0000000000..e368898235
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js
new file mode 100644
index 0000000000..07d490312d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js
new file mode 100644
index 0000000000..7935befd05
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#m);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js
new file mode 100644
index 0000000000..7a9f632c7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete (g().#x);
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..a334ebe864
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m
+);
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..a356406272
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m
+);
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..ece01c0740
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m
+);
+
+ async *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js
new file mode 100644
index 0000000000..02e4fb26d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m
+);
+
+ async #m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js
new file mode 100644
index 0000000000..fd998f6ac1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m
+);
+
+ *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js
new file mode 100644
index 0000000000..4f40fe2fb6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m
+);
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js
new file mode 100644
index 0000000000..fad6f3fcea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#m);
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js
new file mode 100644
index 0000000000..e51d679f5e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-field-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in field, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete (this.#x);
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..13d3c2a740
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class-fields-public, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..dc8cc53146
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-methods-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..cfd5642852
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js
new file mode 100644
index 0000000000..8d0017cd7a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js
new file mode 100644
index 0000000000..aeee377042
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js
new file mode 100644
index 0000000000..15b226efaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js
new file mode 100644
index 0000000000..94d9388a28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#m;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js
new file mode 100644
index 0000000000..1279184624
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete g().#x;
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..af609549ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m
+;
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..c3788377dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m
+;
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..9fb99b093c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m
+;
+
+ async *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js
new file mode 100644
index 0000000000..07027cffdf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m
+;
+
+ async #m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js
new file mode 100644
index 0000000000..1fc96dc94d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m
+;
+
+ *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js
new file mode 100644
index 0000000000..f343d70e52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m
+;
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js
new file mode 100644
index 0000000000..f44b5e2eba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#m;
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js
new file mode 100644
index 0000000000..3684a03b1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-field-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in field)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete this.#x;
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..521df0882e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class-fields-public, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..676ddedde5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-methods-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..b22a41d94e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js
new file mode 100644
index 0000000000..78aa29f4ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js
new file mode 100644
index 0000000000..6fde3047fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js
new file mode 100644
index 0000000000..ae9e2773c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js
new file mode 100644
index 0000000000..a805848fb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#m));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js
new file mode 100644
index 0000000000..79757d74aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ g = this.f;
+ x = delete ((g().#x));
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..84eed95eb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m
+));
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..1406396b52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m
+));
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..7a47defea3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m
+));
+
+ async *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js
new file mode 100644
index 0000000000..e56fa55529
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m
+));
+
+ async #m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js
new file mode 100644
index 0000000000..97a9234bbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m
+));
+
+ *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js
new file mode 100644
index 0000000000..3a05b6575a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m
+));
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js
new file mode 100644
index 0000000000..eb6130794f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#m));
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js
new file mode 100644
index 0000000000..354e0c8746
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-field-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in field, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x = delete ((this.#x));
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..1d59d48077
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class-fields-public, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..088f8034c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-methods-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..f2537ac404
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js
new file mode 100644
index 0000000000..ece3271eac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js
new file mode 100644
index 0000000000..45748d6453
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js
new file mode 100644
index 0000000000..3268a64c8b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js
new file mode 100644
index 0000000000..b2bf807f91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#m);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js
new file mode 100644
index 0000000000..ce67c08981
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete (g().#x);
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..6a33ec513a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m
+);
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..8599c6db4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m
+);
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..b51764253f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m
+);
+ }
+
+ async *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js
new file mode 100644
index 0000000000..ba8f5379aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m
+);
+ }
+
+ async #m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js
new file mode 100644
index 0000000000..6ab21db9ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m
+);
+ }
+
+ *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js
new file mode 100644
index 0000000000..4d5ed5fafd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m
+);
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js
new file mode 100644
index 0000000000..7dd3a6f614
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#m);
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js
new file mode 100644
index 0000000000..e37573bb18
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-method-delete-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in method, covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete (this.#x);
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..64782fb080
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class-fields-public, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..269fb608db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-methods-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..664f377763
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js
new file mode 100644
index 0000000000..a98ceca0cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js
new file mode 100644
index 0000000000..84833780fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js
new file mode 100644
index 0000000000..835ed1fd44
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js
new file mode 100644
index 0000000000..a7376b9182
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#m;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js
new file mode 100644
index 0000000000..2c99382921
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete g().#x;
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..673f8a9150
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m
+;
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..bb0c6fe2a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m
+;
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..beace328f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m
+;
+ }
+
+ async *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js
new file mode 100644
index 0000000000..2c1bb28812
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m
+;
+ }
+
+ async #m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js
new file mode 100644
index 0000000000..309a961850
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m
+;
+ }
+
+ *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js
new file mode 100644
index 0000000000..ad7e8213a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m
+;
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js
new file mode 100644
index 0000000000..aac0c28dbf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#m;
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js
new file mode 100644
index 0000000000..2bce7badb7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-method-delete.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in method)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete this.#x;
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..c775181794
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class-fields-public, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..1b5d682217
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private, class-methods-private, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..73e6d13717
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js
new file mode 100644
index 0000000000..ff22910b9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js
new file mode 100644
index 0000000000..178c58cc17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js
new file mode 100644
index 0000000000..804878eeae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js
new file mode 100644
index 0000000000..9879a56843
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#m));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js
new file mode 100644
index 0000000000..d5aaaf5cc9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-call-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+ var g = this.f;
+ delete ((g().#x));
+ }
+
+ f() {
+ return this;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js
new file mode 100644
index 0000000000..13e1285307
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m
+));
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js
new file mode 100644
index 0000000000..05b109751a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m
+));
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js
new file mode 100644
index 0000000000..df019414c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-iteration, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m
+));
+ }
+
+ async *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js
new file mode 100644
index 0000000000..5571e89254
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-async.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, async-functions, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m
+));
+ }
+
+ async #m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js
new file mode 100644
index 0000000000..c776e1f41b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method-gen.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, generators, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m
+));
+ }
+
+ *#m() {}
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js
new file mode 100644
index 0000000000..d18c53884f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js
@@ -0,0 +1,48 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-method.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class-methods-private, class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m
+));
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js
new file mode 100644
index 0000000000..fce05e88ba
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-private-no-reference.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#m));
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js
new file mode 100644
index 0000000000..b7c06248fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/err-delete-member-expression-privatename.case
+// - src/class-elements/delete-error/cls-expr-method-delete-twice-covered.template
+/*---
+description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in method, recursively covered)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-private]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ This file must never use the onlyStrict flag as the strict mode should always
+ be observed inside class bodies.
+
+ Static Semantics: Early Errors
+
+ UnaryExpression : delete UnaryExpression
+
+ It is a Syntax Error if the UnaryExpression is contained in strict mode
+ code and the derived UnaryExpression is
+ PrimaryExpression : IdentifierReference ,
+ MemberExpression : MemberExpression.PrivateName , or
+ CallExpression : CallExpression.PrivateName .
+
+ It is a Syntax Error if the derived UnaryExpression is
+ PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and
+ CoverParenthesizedExpressionAndArrowParameterList ultimately derives a
+ phrase that, if used in place of UnaryExpression, would produce a
+ Syntax Error according to these rules. This rule is recursively applied.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ x() {
+
+ delete ((this.#x));
+ }
+
+
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/shell.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/delete/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js
new file mode 100644
index 0000000000..03da89dd58
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-class-body-ctor-duplicate.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It is a SyntaxError if the class body has more than one constructor (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more
+ than one occurrence of "constructor".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ constructor() {}
+ constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js
new file mode 100644
index 0000000000..b5bed2447f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-ctor-super-no-heritage.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It is a SyntaxError if class has no heritage and constructor has a direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassTail : ClassHeritageopt { ClassBody }
+
+ It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
+ 1. Let constructor be ConstructorMethod of ClassBody.
+ 2. If constructor is empty, return false.
+ 3. Return HasDirectSuper of constructor.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ constructor() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js
new file mode 100644
index 0000000000..8eb2bdf13e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js
@@ -0,0 +1,71 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-identifier-invalid-ues-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ \u0000;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js
new file mode 100644
index 0000000000..5593b75c4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js
@@ -0,0 +1,71 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-identifier-invalid-zwj-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ \u200D_ZWJ;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js
new file mode 100644
index 0000000000..f116c19c29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js
@@ -0,0 +1,71 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-identifier-invalid-zwnj-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ \u200C_ZWNJ;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-fields-same-line-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-fields-same-line-error.js
new file mode 100644
index 0000000000..195c83740f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-fields-same-line-error.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-fields-same-line-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: SyntaxError (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x y
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js
new file mode 100644
index 0000000000..1b8d6f8ca8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-environment-on-class-heritage-array-literal.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name. (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context.
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ 8. If ClassBodyopt is present, then
+ a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt,
+ i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true).
+ 9. If ClassHeritageopt is not present, then
+ a. Let protoParent be the intrinsic object %ObjectPrototype%.
+ b. Let constructorParent be the intrinsic object %FunctionPrototype%.
+ 10. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage.
+ ...
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends (o) => [o.#foo]
+{
+ #foo;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js
new file mode 100644
index 0000000000..67f2881a6b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-environment-on-class-heritage-chained-usage.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class expression evaluated on ClassHeritage uses an private name declared on subclass. (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context.
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ 8. If ClassBodyopt is present, then
+ a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt,
+ i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true).
+ 9. If ClassHeritageopt is not present, then
+ a. Let protoParent be the intrinsic object %ObjectPrototype%.
+ b. Let constructorParent be the intrinsic object %FunctionPrototype%.
+ 10. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage.
+ ...
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends class extends class extends class { x = this.#foo; } { #foo; x = this.#bar; } { #bar; x = this.#fuz; }
+{
+ #fuz;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js
new file mode 100644
index 0000000000..78d3c79f4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-environment-on-class-heritage-function-expression.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a function expression evaluated on ClassHeritage uses a private name. (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context.
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ 8. If ClassBodyopt is present, then
+ a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt,
+ i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true).
+ 9. If ClassHeritageopt is not present, then
+ a. Let protoParent be the intrinsic object %ObjectPrototype%.
+ b. Let constructorParent be the intrinsic object %FunctionPrototype%.
+ 10. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage.
+ ...
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends function() { x = this.#foo; }
+{
+ #foo;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js
new file mode 100644
index 0000000000..570352da10
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-environment-on-class-heritage-obj-literal.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a object literal evaluated on ClassHeritage uses a private name. (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context.
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ 8. If ClassBodyopt is present, then
+ a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt,
+ i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true).
+ 9. If ClassHeritageopt is not present, then
+ a. Let protoParent be the intrinsic object %ObjectPrototype%.
+ b. Let constructorParent be the intrinsic object %FunctionPrototype%.
+ 10. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage.
+ ...
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends (o) => {x: o.#foo}
+{
+ #foo;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js
new file mode 100644
index 0000000000..1e05ce0ee9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-environment-on-class-heritage-recursive.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class expression evaluated on ClassHeritage of a ClassHeritage uses an undeclared private name. (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context.
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ 8. If ClassBodyopt is present, then
+ a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt,
+ i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true).
+ 9. If ClassHeritageopt is not present, then
+ a. Let protoParent be the intrinsic object %ObjectPrototype%.
+ b. Let constructorParent be the intrinsic object %FunctionPrototype%.
+ 10. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage.
+ ...
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends class extends class { x = this.#foo; } {}
+{
+ #foo;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js
new file mode 100644
index 0000000000..0595a11b49
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-environment-on-class-heritage.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class expression evaluated on ClassHeritage uses an undeclared private name. (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context.
+ 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment).
+ 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord.
+ 8. If ClassBodyopt is present, then
+ a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt,
+ i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true).
+ 9. If ClassHeritageopt is not present, then
+ a. Let protoParent be the intrinsic object %ObjectPrototype%.
+ b. Let constructorParent be the intrinsic object %FunctionPrototype%.
+ 10. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage.
+ ...
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends class { x = this.#foo; }
+{
+ #foo;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js
new file mode 100644
index 0000000000..36e44e5068
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js
@@ -0,0 +1,33 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-field-on-object-destructuring.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Acessing private field from object destructuring pattern is not a valid syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, destructuring-binding, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ObjectAssignmentPattern[Yield, Await]:
+ {}
+ {AssignmentRestProperty[?Yield, ?Await]}
+ {AssignmentPropertyList[?Yield, ?Await]}
+ {AssignmentPropertyList[?Yield, ?Await],AssignmentRestProperty[?Yield, ?Await]opt}
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x = 1;
+
+ destructureX() {
+ const { #x: x } = this;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-super-access.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-super-access.js
new file mode 100644
index 0000000000..89e8c0f22a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-private-field-super-access.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-private-field-super-access.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Acessing private field from super is not a valid syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ MemberExpression[Yield]:
+ MemberExpression[?Yield].PrivateName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m = function() { return 'test262'; };
+
+ Child = class extends C {
+ access() {
+ return super.#m;
+ }
+
+ method() {
+ return super.#m();
+ }
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js
new file mode 100644
index 0000000000..5e1f7f40af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-async-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private async generator and a private field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-fields-private, async-iteration, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m;
+ async * #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js
new file mode 100644
index 0000000000..37b14b65bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-async.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private async function and a private field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-fields-private, async-functions, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m;
+ async #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js
new file mode 100644
index 0000000000..33cb1fa13f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private generator and a private field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-fields-private, generators, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m;
+ * #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js
new file mode 100644
index 0000000000..4a7d5fcc74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-get-field.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private getter and a private field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m;
+ get #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js
new file mode 100644
index 0000000000..6532ab3fe4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-get-get.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains multiple private getters with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ get #m() {}
+ get #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js
new file mode 100644
index 0000000000..3e45b92222
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-field.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private method and a private field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m;
+ #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js
new file mode 100644
index 0000000000..3e8d39fbf1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-get.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private method and a private getter with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ get #m() {}
+ #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js
new file mode 100644
index 0000000000..964f4b7995
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains multiple private methods with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m() {}
+ #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js
new file mode 100644
index 0000000000..f474ee6b7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-set.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private method and a private setter with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ set #m(_) {}
+ #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js
new file mode 100644
index 0000000000..a979dddd35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-staticfield.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private method and a private static field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-static-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #m;
+ #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js
new file mode 100644
index 0000000000..bca26607c5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-staticmeth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private method and a private static method with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #m() {}
+ #m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js
new file mode 100644
index 0000000000..d122f531ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-set-field.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains a private setter and a private field with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #m;
+ set #m(_) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js
new file mode 100644
index 0000000000..63d3a13eaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-set-set.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It's a SyntaxError if a class contains multiple private setters with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ set #m(_) {}
+ set #m(_) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-constructor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-constructor.js
new file mode 100644
index 0000000000..cf1e2a3ee5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-constructor.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-constructor.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Private Fields cannot be named constructor (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElementName : PrivateName ;
+ It is a Syntax Error if StringValue of PrivateName is "#constructor"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #constructor
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-error.js
new file mode 100644
index 0000000000..81043fa4dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-error.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigial and IdentifierName (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ # x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js
new file mode 100644
index 0000000000..dfd9d8e4a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js
@@ -0,0 +1,65 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-invalid-ues.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Valid PrivateName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #\u0000;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js
new file mode 100644
index 0000000000..ea09d25bae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-invalid-zwj-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Valid PrivateName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #\u200D_ZWJ;
+
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js
new file mode 100644
index 0000000000..fcb16ab416
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js
@@ -0,0 +1,66 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-invalid-zwnj-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Valid PrivateName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #\u200C_ZWNJ;
+
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js
new file mode 100644
index 0000000000..da1b15e591
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-in-computed-property-missing.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Use of undeclared PrivateName in ComputedProperty is a syntax error (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class-fields-public, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElementName:
+ PropertyName
+ PrivateIdentifier
+
+ PropertyName:
+ LiteralPropertyName
+ ComputedPropertyName
+
+ ComputedPropertyName:
+ [ AssignmentExpression ]
+
+ AssignmentExpression ... MemberExpression
+
+ MemberExpression:
+ MemberExpression . PrivateName
+
+ Static Semantics: AllPrivateIdentifiersValid
+ AllPrivateIdentifiersValid is an abstract operation which takes names as an argument.
+
+ MemberExpression : MemberExpression . PrivateIdentifier
+ 1. If StringValue of PrivateIdentifier is in names, return true.
+ 2. Return false.
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundIdentifiers of ClassBody.
+ 2. Return AllPrivateIdentifiersValid of ClassElementList with the argument newNames.
+
+ Static Semantics: Early Errors
+
+ ScriptBody : StatementList
+ It is a Syntax Error if AllPrivateIdentifiersValid of StatementList with an empty List as an argument is false unless the source code is eval code that is being processed by a direct eval.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ [this.#f] = 'Test262'
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js
new file mode 100644
index 0000000000..baf4ed6809
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-accessor-get-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName () (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ get # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js
new file mode 100644
index 0000000000..113af0007f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-accessor-set-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Accessor set Method) (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ set # m(_) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js
new file mode 100644
index 0000000000..7d2c9a6cd6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-async-gen-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Async Generator Method) (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ async * # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js
new file mode 100644
index 0000000000..1e3fe1815c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-async-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Async Method) (class expression)
+esid: prod-ClassElement
+features: [async-functions, class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ async # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js
new file mode 100644
index 0000000000..d0461d7a90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-call-expr.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (CallExpression) (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ MemberExpression :
+ MemberExpression . PrivateName
+
+ CallExpression :
+ CallExpression . PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+
+ f() {
+ return this;
+ }
+
+ m() {
+ this.f().# x;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js
new file mode 100644
index 0000000000..89fa995f50
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-field-init.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Field with Initializer) (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ # x = 1;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js
new file mode 100644
index 0000000000..df291aac7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-field.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Field) (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ # x;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js
new file mode 100644
index 0000000000..57da2b2c3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-gen-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Generator Method) (class expression)
+esid: prod-ClassElement
+features: [generators, class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ * # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js
new file mode 100644
index 0000000000..9afdf95064
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-member-expr.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (MemberExpression) (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ MemberExpression :
+ MemberExpression . PrivateName
+
+ CallExpression :
+ CallExpression . PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x;
+ m() {
+ this.# x;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js
new file mode 100644
index 0000000000..859d49c5dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-meth.case.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Method) (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js
new file mode 100644
index 0000000000..13d9e1fdf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-accessor-get-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Accessor get Method) (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static get # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js
new file mode 100644
index 0000000000..38937b2f6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-accessor-set-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Accessor set Method) (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static set # m(_) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js
new file mode 100644
index 0000000000..e351811145
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-async-gen-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Async Generator Method) (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static async * # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js
new file mode 100644
index 0000000000..f06dfe12c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-async-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Async Method) (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static async # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js
new file mode 100644
index 0000000000..3a5104c1a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-field-init.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Field with Initializer) (class expression)
+esid: prod-ClassElement
+features: [class-static-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static # x = 1;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js
new file mode 100644
index 0000000000..90e18f3ca8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-field.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Field) (class expression)
+esid: prod-ClassElement
+features: [class-static-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static # x;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js
new file mode 100644
index 0000000000..83dd76ba01
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-gen-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Generator Method) (class expression)
+esid: prod-ClassElement
+features: [generators, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static * # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js
new file mode 100644
index 0000000000..2187eacfc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js
@@ -0,0 +1,30 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-whitespace-error-static-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: No space allowed between sigil and IdentifierName (Static Method) (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Updated Productions
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static # m() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js
new file mode 100644
index 0000000000..50afad12ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatenames-same-line-error.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: SyntaxError (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ #x #y
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js
new file mode 100644
index 0000000000..4a14cfc68a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-async-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Async Generator Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ async * method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js
new file mode 100644
index 0000000000..4e730e6cce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-async.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Async Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-functions, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ async method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js
new file mode 100644
index 0000000000..ed359acf1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Generator Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [generators, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ * method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js
new file mode 100644
index 0000000000..abe21071b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-get.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Accessor get Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ get method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js
new file mode 100644
index 0000000000..65ff8cedb9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-method.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js
new file mode 100644
index 0000000000..220d38438a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-private-async-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Private Async Generators Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ async * #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js
new file mode 100644
index 0000000000..a7c65a536b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-private-async.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Private Async Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-functions, class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ async #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js
new file mode 100644
index 0000000000..8b1df2d381
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-private-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Private Generators Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [generators, class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ * #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js
new file mode 100644
index 0000000000..68e3af892a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-private-method.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Private Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js
new file mode 100644
index 0000000000..ea1f444e26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-contains-super-set.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Accessor set Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ set method(_) {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js
new file mode 100644
index 0000000000..fafd93217e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-ctor-async-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Async Generator Methods cannot be named "constructor" (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ async * constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js
new file mode 100644
index 0000000000..2ddc1484a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-ctor-async-meth.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Async Methods cannot be named "constructor" (class expression)
+esid: prod-ClassElement
+features: [async-functions, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ async constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js
new file mode 100644
index 0000000000..d2a097d885
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-ctor-gen.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Generator Methods cannot be named "constructor" (class expression)
+esid: prod-ClassElement
+features: [generators, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ * constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js
new file mode 100644
index 0000000000..1f7a82091c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-ctor-get.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Accessor get Methods cannot be named "constructor" (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ get constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js
new file mode 100644
index 0000000000..f4d0eb692f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-meth-ctor-set.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Accessor set Methods cannot be named "constructor" (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ set constructor(_) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js
new file mode 100644
index 0000000000..71ed3b4c64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-async-gen-meth-prototype.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Generator Methods cannot be named prototype (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static async * prototype() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js
new file mode 100644
index 0000000000..c9210159fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-async-gen-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Generator Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static async * method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js
new file mode 100644
index 0000000000..2bddcc2c09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-async-meth-prototype.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Methods cannot be named prototype (class expression)
+esid: prod-ClassElement
+features: [async-functions, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static async prototype() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-super.js
new file mode 100644
index 0000000000..aa40e45b51
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-async-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-async-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-functions, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static async method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js
new file mode 100644
index 0000000000..9a596bc853
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-gen-meth-prototype.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Generator Methods cannot be named prototype (class expression)
+esid: prod-ClassElement
+features: [generators, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static * prototype() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js
new file mode 100644
index 0000000000..def3cb1572
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-gen-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Generator Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [generators, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static * method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js
new file mode 100644
index 0000000000..554b88539b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-get-meth-prototype.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Accessor get Methods cannot be named prototype (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static get prototype() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-super.js
new file mode 100644
index 0000000000..5a8909c4e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-get-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-get-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Accessor get Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static get method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-prototype.js
new file mode 100644
index 0000000000..6db6567c1a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-prototype.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-meth-prototype.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Methods cannot be named prototype (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static prototype() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-super.js
new file mode 100644
index 0000000000..caf2ae5f50
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js
new file mode 100644
index 0000000000..92f086b6a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-async-gen-meth-constructor.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Generator Private Methods cannot be named constructor (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElementName : PrivateName ;
+ It is a Syntax Error if StringValue of PrivateName is "#constructor"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static async * #constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js
new file mode 100644
index 0000000000..c1719b9215
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-async-gen-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Generator Private Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static async * #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js
new file mode 100644
index 0000000000..b49bbf5cab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-async-meth-constructor.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Private Methods cannot be named constructor (class expression)
+esid: prod-ClassElement
+features: [async-functions, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElementName : PrivateName ;
+ It is a Syntax Error if StringValue of PrivateName is "#constructor"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static async #constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js
new file mode 100644
index 0000000000..832a75fa7d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-async-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Async Private Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [async-functions, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static async #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js
new file mode 100644
index 0000000000..24c41d3c85
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-gen-meth-constructor.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Generator Private Methods cannot be named constructor (class expression)
+esid: prod-ClassElement
+features: [generators, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElementName : PrivateName ;
+ It is a Syntax Error if StringValue of PrivateName is "#constructor"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static * #constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js
new file mode 100644
index 0000000000..c6b35a444d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-gen-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Generator Private Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [generators, class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static * #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js
new file mode 100644
index 0000000000..32e9274eac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-meth-constructor.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Private Methods cannot be named constructor (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElementName : PrivateName ;
+ It is a Syntax Error if StringValue of PrivateName is "#constructor"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #constructor() {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-super.js
new file mode 100644
index 0000000000..fe96b06914
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-private-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Private Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static #method() {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js
new file mode 100644
index 0000000000..ef424f652f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-privatename-constructor.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Private Fields cannot be named constructor (class expression)
+esid: prod-ClassElement
+features: [class-static-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElementName : PrivateName ;
+ It is a Syntax Error if StringValue of PrivateName is "#constructor"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static #constructor
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js
new file mode 100644
index 0000000000..b70a612536
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-set-meth-prototype.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Accessor set Methods cannot be named prototype (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ static set prototype(_) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-super.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-super.js
new file mode 100644
index 0000000000..a007d94d20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-static-set-meth-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-set-meth-super.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: Static Accessor set Methods cannot contain direct super (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends Function{
+ static set method(_) {
+ super();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/browser.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js
new file mode 100644
index 0000000000..082a9c2ea1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-field-initializer.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = (() => {})().#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js
new file mode 100644
index 0000000000..5ccb930ac6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-field-initializer.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = (() => this)().#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js
new file mode 100644
index 0000000000..adc3600857
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-fn.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, function in class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = function() { (() => {})().#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js
new file mode 100644
index 0000000000..f94e296d59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-fn.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, function in class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = function() { (() => this)().#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js
new file mode 100644
index 0000000000..011e64fcaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-fn.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, function in class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = function() { something.#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js
new file mode 100644
index 0000000000..1e94438481
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-fn.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, function in class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = function() { this.#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-bad-reference.js
new file mode 100644
index 0000000000..cbb5478bea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-bad-reference.js
@@ -0,0 +1,57 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-heritage.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, field initializer in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ f = (() => {})().#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-this.js
new file mode 100644
index 0000000000..fc59fbf308
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-call-expression-this.js
@@ -0,0 +1,57 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-heritage.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, field initializer in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ f = (() => this)().#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-bad-reference.js
new file mode 100644
index 0000000000..1ad9d43575
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-bad-reference.js
@@ -0,0 +1,57 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-heritage.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, field initializer in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ f = something.#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-this.js
new file mode 100644
index 0000000000..88584a739d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-heritage-member-expression-this.js
@@ -0,0 +1,57 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-field-initializer-heritage.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, field initializer in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ f = this.#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js
new file mode 100644
index 0000000000..9ae859e062
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-field-initializer.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = something.#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js
new file mode 100644
index 0000000000..7c67f5b0e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-field-initializer.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, class field initializer in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ f = this.#x
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js
new file mode 100644
index 0000000000..556abc11bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-method.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() { (() => {})().#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js
new file mode 100644
index 0000000000..7f25a597cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-method.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() { (() => this)().#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js
new file mode 100644
index 0000000000..3aac1ddd02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-method-fn.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, inner function in method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ function fn() { (() => {})().#x }
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js
new file mode 100644
index 0000000000..d99799a255
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-method-fn.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, inner function in method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ function fn() { (() => this)().#x }
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js
new file mode 100644
index 0000000000..8486f6ce61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-method-fn.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, inner function in method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ function fn() { something.#x }
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js
new file mode 100644
index 0000000000..9242fe4448
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-method-fn.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, inner function in method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ function fn() { this.#x }
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js
new file mode 100644
index 0000000000..c599da9b62
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-method-heritage.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, method in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ m() {
+ (() => {})().#x
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js
new file mode 100644
index 0000000000..9e60290764
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-method-heritage.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, method in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ m() {
+ (() => this)().#x
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js
new file mode 100644
index 0000000000..02cf2dca97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-method-heritage.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, method in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ m() {
+ something.#x
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js
new file mode 100644
index 0000000000..4879b83507
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-method-heritage.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, method in inner class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+class Parent {
+ #x = 42;
+}
+
+var C = class extends Parent {
+ m() {
+ this.#x
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js
new file mode 100644
index 0000000000..2ec080e169
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-method.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() { something.#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js
new file mode 100644
index 0000000000..13ac14d96e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js
@@ -0,0 +1,53 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-method.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, method in class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() { this.#x }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js
new file mode 100644
index 0000000000..3dd3255370
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-outter-method.template
+/*---
+description: bad reference in call expression (Invalid private names should throw a SyntaxError, method in outter class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ class Outter {
+ #x = 42;
+ }
+
+ this.#x;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js
new file mode 100644
index 0000000000..13f1d684be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/call-expression-this.case
+// - src/invalid-private-names/default/cls-expr-outter-method.template
+/*---
+description: this evaluated in call expression (Invalid private names should throw a SyntaxError, method in outter class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ class Outter {
+ #x = 42;
+ }
+
+ this.#x;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js
new file mode 100644
index 0000000000..99c238f82c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-bad-reference.case
+// - src/invalid-private-names/default/cls-expr-outter-method.template
+/*---
+description: bad reference in member expression (Invalid private names should throw a SyntaxError, method in outter class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ class Outter {
+ #x = 42;
+ }
+
+ this.#x;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js
new file mode 100644
index 0000000000..bf3969eada
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js
@@ -0,0 +1,59 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/invalid-private-names/member-expression-this.case
+// - src/invalid-private-names/default/cls-expr-outter-method.template
+/*---
+description: this reference in member expression (Invalid private names should throw a SyntaxError, method in outter class expression)
+esid: sec-static-semantics-early-errors
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ScriptBody:StatementList
+ It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List
+ as an argument is false unless the source code is eval code that is being
+ processed by a direct eval.
+
+ ModuleBody:ModuleItemList
+ It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List
+ as an argument is false.
+
+ Static Semantics: AllPrivateNamesValid
+
+ ClassBody : ClassElementList
+ 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody.
+ 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames.
+
+ For all other grammatical productions, recurse on subexpressions/substatements,
+ passing in the names of the caller. If all pieces return true, then return true.
+ If any returns false, return false.
+
+
+ Static Semantics: AllPrivateNamesValid
+
+ MemberExpression : MemberExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+ CallExpression : CallExpression . PrivateName
+
+ 1. If StringValue of PrivateName is in names, return true.
+ 2. Return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ m() {
+ class Outter {
+ #x = 42;
+ }
+
+ this.#x;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/shell.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/invalid-names/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js
new file mode 100644
index 0000000000..4bbf633a8f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-async-generator-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private async generator cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, async-iteration, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName::
+ # IdentifierName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ async * \u0023m() { return 42; }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js
new file mode 100644
index 0000000000..d84f14a988
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-async-method-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private async method cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, async-functions, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName::
+ # IdentifierName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ async \u0023m() { return 42; }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js
new file mode 100644
index 0000000000..bad61fd517
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-call-exp-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private reference cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName ::
+ # IdentifierName
+
+ MemberExpression :
+ MemberExpression . PrivateName
+
+ CallExpression :
+ CallExpression . PrivateName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ method() {
+ foo().\u0023field;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-field-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-field-cannot-escape-token.js
new file mode 100644
index 0000000000..9b9b745db7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-field-cannot-escape-token.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private field cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName::
+ # IdentifierName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ \u0023field;
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js
new file mode 100644
index 0000000000..30b26920ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-generator-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private generator cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, generators, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName::
+ # IdentifierName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ * \u0023m() { return 42; }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js
new file mode 100644
index 0000000000..8e4e6d321d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js
@@ -0,0 +1,34 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-member-exp-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private reference cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName ::
+ # IdentifierName
+
+ MemberExpression :
+ MemberExpression . PrivateName
+
+ CallExpression :
+ CallExpression . PrivateName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ method() {
+ this.\u0023field;
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-method-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-method-cannot-escape-token.js
new file mode 100644
index 0000000000..bfd4b3bcbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/private-method-cannot-escape-token.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-cannot-escape-token.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: The pound signal in the private method cannot be escaped (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ PrivateName::
+ # IdentifierName
+
+ U+0023 is the escape sequence for #
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ \u0023m() { return 42; }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/shell.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js
new file mode 100644
index 0000000000..9c3a577979
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/super-private-access-invalid.case
+// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
+/*---
+description: It is syntax error if PrivateName IdentifierName is accessed on SuperProperty (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ SuperProperty:
+ super[Expression]
+ super.IdentifierName
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class extends B
+{
+ #x() {}
+
+ method() {
+ super.#x();
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/shell.js b/js/src/tests/test262/language/expressions/class/elements/syntax/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/browser.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js
new file mode 100644
index 0000000000..92137ad521
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js
@@ -0,0 +1,24 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-class-body-ctor-no-heritage.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: A constructor is valid without a super call in the constructor and heritage (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+info: |
+ ClassTail : ClassHeritageopt { ClassBody }
+
+ It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true:
+ 1. Let constructor be ConstructorMethod of ClassBody.
+ 2. If constructor is empty, return false.
+ 3. Return HasDirectSuper of constructor.
+
+---*/
+
+
+var C = class {
+ constructor() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-accessor.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-accessor.js
new file mode 100644
index 0000000000..6a94bcea16
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-accessor.js
@@ -0,0 +1,27 @@
+// |reftest| skip -- decorators is not supported
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-accessor.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid accessor FieldDefinition, ClassElementName, PropertyName Syntax (class expression)
+esid: prod-ClassElement
+features: [decorators, class]
+flags: [generated]
+info: |
+ FieldDefinition[Yield, Await] :
+ ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt
+ accessor [no LineTerminator here] ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt
+
+---*/
+
+
+var C = class {
+ accessor $;
+ accessor _;
+ accessor \u{6F};
+ accessor \u2118;
+ accessor ZW_\u200C_NJ;
+ accessor ZW_\u200D_J;
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js
new file mode 100644
index 0000000000..1a731074d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-classelementname-initializer-alt.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1;
+ _ = 2;
+ \u{6F} = 3;
+ ℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD
+ ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD
+ ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer.js
new file mode 100644
index 0000000000..f26a8180ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-classelementname-initializer.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-classelementname-initializer.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $ = 1;
+ _ = 2;
+ \u{6F} = 3;
+ \u2118 = 4;
+ ZW_\u200C_NJ = 5;
+ ZW_\u200D_J = 6;
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier-alt.js
new file mode 100644
index 0000000000..fab559ecee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier-alt.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-identifier-alt.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $;
+ _;
+ \u{6F};
+ ℘; // DO NOT CHANGE THE NAME OF THIS FIELD
+ ZW_‌_NJ; // DO NOT CHANGE THE NAME OF THIS FIELD
+ ZW_‍_J; // DO NOT CHANGE THE NAME OF THIS FIELD
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier.js
new file mode 100644
index 0000000000..5557474be6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-field-identifier.js
@@ -0,0 +1,72 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-field-identifier.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+ StringLiteral
+ NumericLiteral
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart ::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart ::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue ::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ $;
+ _;
+ \u{6F};
+ \u2118;
+ ZW_\u200C_NJ;
+ ZW_\u200D_J;
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-fields-multi-line.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-fields-multi-line.js
new file mode 100644
index 0000000000..9843ba163f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-fields-multi-line.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-fields-multi-line.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid multi-line, multi-field (class expression)
+esid: prod-ClassElement
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+---*/
+
+
+var C = class {
+ x
+ y
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js
new file mode 100644
index 0000000000..586be0b345
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js
@@ -0,0 +1,23 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-get-set.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: It's valid if a class contains a private getter and a private setter with the same name (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+var C = class {
+ get #m() {}
+ set #m(_) {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js
new file mode 100644
index 0000000000..87191f4f91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js
@@ -0,0 +1,28 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatemeth-duplicate-meth-nestedclassmeth.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: It's valid if a nested class shadows a private method (class expression)
+esid: prod-ClassElement
+features: [class-methods-private, class]
+flags: [generated]
+info: |
+ Static Semantics: Early Errors
+
+ ClassBody : ClassElementList
+ It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
+
+---*/
+
+
+var C = class {
+ constructor() {
+ class B {
+ #m() {}
+ }
+ }
+
+ #m() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js
new file mode 100644
index 0000000000..d62420cadf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-classelementname-initializer-alt.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid PrivateName = Initializer Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1;
+ #_ = 2;
+ #\u{6F} = 3;
+ #℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD
+ #ZW_‌_NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD
+ #ZW_‍_J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js
new file mode 100644
index 0000000000..590f8b3cfa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-classelementname-initializer.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid PrivateName = Initializer Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ Initializer :
+ = AssignmentExpression
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$ = 1;
+ #_ = 2;
+ #\u{6F} = 3;
+ #\u2118 = 4;
+ #ZW_\u200C_NJ = 5;
+ #ZW_\u200D_J = 6;
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-identifier.js
new file mode 100644
index 0000000000..380dbe7f97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-identifier.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Valid PrivateName Syntax (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ #$;
+ #_;
+ #\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js
new file mode 100644
index 0000000000..d5a422aa4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js
@@ -0,0 +1,34 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-no-initializer-with-method.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: SyntaxError (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x
+ m() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatenames-multi-line.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatenames-multi-line.js
new file mode 100644
index 0000000000..7f2f654bc2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-privatenames-multi-line.js
@@ -0,0 +1,34 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatenames-multi-line.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: SyntaxError (class expression)
+esid: prod-ClassElement
+features: [class-fields-private, class]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ #x
+ #y
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js
new file mode 100644
index 0000000000..5ef5f9b3d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js
@@ -0,0 +1,58 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-prototype-accessor-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Accessor Methods can be named "prototype" (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage_opt { ClassBody_opt }
+
+ [...]
+ 6. Let proto be OrdinaryObjectCreate(protoParent).
+ [...]
+ 14. Perform MakeConstructor(F, false, proto).
+ [...]
+ 20. For each ClassElement m in order from methods, do
+ a. If IsStatic of m is false, then
+ i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ With parameters object and enumerable.
+
+ MethodDefinition : get PropertyName ( ) { FunctionBody }
+
+ [...]
+ 9. Let desc be the PropertyDescriptor { [[Get]]: closure, [[Enumerable]]: enumerable, [[Configurable]]: true }.
+ 10. Return ? DefinePropertyOrThrow(object, propKey, desc).
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ [...]
+ 8. Let desc be the PropertyDescriptor { [[Set]]: closure, [[Enumerable]]: enumerable, [[Configurable]]: true }.
+ 9. Return ? DefinePropertyOrThrow(object, propKey, desc).
+
+---*/
+
+
+var C = class {
+ get prototype() { return 13; }
+ set prototype(_) {}
+};
+
+assert(C.hasOwnProperty('prototype'));
+assert(C.prototype.hasOwnProperty('prototype'));
+assert.notSameValue(C.prototype.prototype, C.prototype);
+assert.sameValue(C.prototype.prototype, 13);
+verifyProperty(C.prototype, 'prototype', {
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js
new file mode 100644
index 0000000000..fc5e1bfacd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-prototype-async-gen-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Async Generator Methods can be named "prototype" (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage_opt { ClassBody_opt }
+
+ [...]
+ 6. Let proto be OrdinaryObjectCreate(protoParent).
+ [...]
+ 14. Perform MakeConstructor(F, false, proto).
+ [...]
+ 20. For each ClassElement m in order from methods, do
+ a. If IsStatic of m is false, then
+ i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ With parameters object and enumerable.
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 10. Let desc be PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }.
+ 11. Return ? DefinePropertyOrThrow(object, propKey, desc).
+
+---*/
+
+
+var C = class {
+ async * prototype() {}
+};
+
+assert(C.hasOwnProperty('prototype'));
+assert(C.prototype.hasOwnProperty('prototype'));
+assert.notSameValue(C.prototype.prototype, C.prototype);
+verifyProperty(C.prototype, 'prototype', {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js
new file mode 100644
index 0000000000..f6e24e4aff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-prototype-async-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Async Methods can be named "prototype" (class expression)
+esid: prod-ClassElement
+features: [async-functions, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage_opt { ClassBody_opt }
+
+ [...]
+ 6. Let proto be OrdinaryObjectCreate(protoParent).
+ [...]
+ 14. Perform MakeConstructor(F, false, proto).
+ [...]
+ 20. For each ClassElement m in order from methods, do
+ a. If IsStatic of m is false, then
+ i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ With parameters object and enumerable.
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ [...]
+ 8. Let desc be the PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }.
+ 9. Return ? DefinePropertyOrThrow(object, propKey, desc).
+
+---*/
+
+
+var C = class {
+ async prototype() {}
+};
+
+assert(C.hasOwnProperty('prototype'));
+assert(C.prototype.hasOwnProperty('prototype'));
+assert.notSameValue(C.prototype.prototype, C.prototype);
+verifyProperty(C.prototype, 'prototype', {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js
new file mode 100644
index 0000000000..83676bd5ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-prototype-gen-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Generator Methods can be named "prototype" (class expression)
+esid: prod-ClassElement
+features: [generators, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage_opt { ClassBody_opt }
+
+ [...]
+ 6. Let proto be OrdinaryObjectCreate(protoParent).
+ [...]
+ 14. Perform MakeConstructor(F, false, proto).
+ [...]
+ 20. For each ClassElement m in order from methods, do
+ a. If IsStatic of m is false, then
+ i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ With parameters object and enumerable.
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ [...]
+ 10. Let desc be the PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }.
+ 11. Return ? DefinePropertyOrThrow(object, propKey, desc).
+
+---*/
+
+
+var C = class {
+ * prototype() {}
+};
+
+assert(C.hasOwnProperty('prototype'));
+assert(C.prototype.hasOwnProperty('prototype'));
+assert.notSameValue(C.prototype.prototype, C.prototype);
+verifyProperty(C.prototype, 'prototype', {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js
new file mode 100644
index 0000000000..790bb30409
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js
@@ -0,0 +1,51 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-special-prototype-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Methods can be named "prototype" (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage_opt { ClassBody_opt }
+
+ [...]
+ 6. Let proto be OrdinaryObjectCreate(protoParent).
+ [...]
+ 14. Perform MakeConstructor(F, false, proto).
+ [...]
+ 20. For each ClassElement m in order from methods, do
+ a. If IsStatic of m is false, then
+ i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ With parameters object and enumerable.
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let desc be the PropertyDescriptor { [[Value]]: methodDef.[[Closure]], [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }.
+ 4. Return ? DefinePropertyOrThrow(object, methodDef.[[Key]], desc).
+
+---*/
+
+
+var C = class {
+ prototype() {}
+};
+
+assert(C.hasOwnProperty('prototype'));
+assert(C.prototype.hasOwnProperty('prototype'));
+assert.notSameValue(C.prototype.prototype, C.prototype);
+verifyProperty(C.prototype, 'prototype', {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js
new file mode 100644
index 0000000000..6efb50847b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js
@@ -0,0 +1,32 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-ctor-accessor-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Accessor Methods can be named constructor (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "prototype".
+
+---*/
+
+
+var C = class {
+ static get constructor() {}
+ static set constructor(_) {}
+ constructor() {} // stacks with a valid constructor
+};
+
+assert(C.hasOwnProperty('constructor'));
+assert(C.prototype.hasOwnProperty('constructor'));
+assert.notSameValue(C.prototype.constructor, C.constructor);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js
new file mode 100644
index 0000000000..2689f31801
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-ctor-async-gen-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Async Generator Methods can be named constructor (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "prototype".
+
+---*/
+
+
+var C = class {
+ static async * constructor() {}
+ constructor() {} // stacks with a valid constructor
+};
+
+assert(C.hasOwnProperty('constructor'));
+assert(C.prototype.hasOwnProperty('constructor'));
+assert.notSameValue(C.prototype.constructor, C.constructor);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js
new file mode 100644
index 0000000000..757b3a45db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-ctor-async-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Methods can be named constructor (class expression)
+esid: prod-ClassElement
+features: [async-functions, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "prototype".
+
+---*/
+
+
+var C = class {
+ static async constructor() {}
+ constructor() {} // stacks with a valid constructor
+};
+
+assert(C.hasOwnProperty('constructor'));
+assert(C.prototype.hasOwnProperty('constructor'));
+assert.notSameValue(C.prototype.constructor, C.constructor);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js
new file mode 100644
index 0000000000..af241a4866
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-ctor-gen-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Generator Methods can be named constructor (class expression)
+esid: prod-ClassElement
+features: [generators, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "prototype".
+
+---*/
+
+
+var C = class {
+ static * constructor() {}
+ constructor() {} // stacks with a valid constructor
+};
+
+assert(C.hasOwnProperty('constructor'));
+assert(C.prototype.hasOwnProperty('constructor'));
+assert.notSameValue(C.prototype.constructor, C.constructor);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js
new file mode 100644
index 0000000000..41908e065d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-ctor-meth-valid.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Methods can be named constructor (class expression)
+esid: prod-ClassElement
+features: [class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
+ It is a Syntax Error if PropName of MethodDefinition is "prototype".
+
+---*/
+
+
+var C = class {
+ static constructor() {}
+ constructor() {} // stacks with a valid constructor
+};
+
+assert(C.hasOwnProperty('constructor'));
+assert(C.prototype.hasOwnProperty('constructor'));
+assert.notSameValue(C.prototype.constructor, C.constructor);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js
new file mode 100644
index 0000000000..a0cc8261ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js
@@ -0,0 +1,22 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-async-gen-meth-prototype.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Async Generator Private Methods can be named "#prototype" (class expression)
+esid: prod-ClassElement
+features: [async-iteration, class-static-methods-private, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+var C = class {
+ static async * #prototype() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js
new file mode 100644
index 0000000000..d7be0ccaaa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js
@@ -0,0 +1,22 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-async-meth-prototype.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Async Private Methods can be named "#prototype" (class expression)
+esid: prod-ClassElement
+features: [async-functions, class-static-methods-private, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+var C = class {
+ static async #prototype() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js
new file mode 100644
index 0000000000..ae0b509dcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js
@@ -0,0 +1,22 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-gen-meth-prototype.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Generator Private Methods can be named "#prototype" (class expression)
+esid: prod-ClassElement
+features: [generators, class-static-methods-private, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+var C = class {
+ static * #prototype() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-meth-prototype.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-meth-prototype.js
new file mode 100644
index 0000000000..a2b8e5950f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/grammar-static-private-meth-prototype.js
@@ -0,0 +1,22 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-static-private-meth-prototype.case
+// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
+/*---
+description: Static Private Methods can be named "#prototype" (class expression)
+esid: prod-ClassElement
+features: [class-static-methods-private, class]
+flags: [generated]
+info: |
+ Class Definitions / Static Semantics: Early Errors
+
+ ClassElement : static MethodDefinition
+ It is a Syntax Error if PropName of MethodDefinition is "prototype"
+
+---*/
+
+
+var C = class {
+ static #prototype() {}
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/syntax/valid/shell.js b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/syntax/valid/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-arguments.js
new file mode 100644
index 0000000000..39c220b5b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-ternary.template
+/*---
+description: Syntax error if `arguments` used in class field (ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = true ? {} : arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-super.js
new file mode 100644
index 0000000000..c99488b0fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/ternary-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-ternary.template
+/*---
+description: Syntax error if `super()` used in class field (ternary expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = true ? {} : super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-arguments.js b/js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-arguments.js
new file mode 100644
index 0000000000..94324d65a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-arguments.js
@@ -0,0 +1,35 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-arguments.case
+// - src/class-elements/initializer-error/cls-expr-fields-typeof.template
+/*---
+description: Syntax error if `arguments` used in class field (typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if ContainsArguments of Initializer is true.
+
+ Static Semantics: ContainsArguments
+ IdentifierReference : Identifier
+
+ 1. If the StringValue of Identifier is "arguments", return true.
+ ...
+ For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = typeof arguments;
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-super.js b/js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-super.js
new file mode 100644
index 0000000000..b194a0bb75
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/typeof-init-err-contains-super.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/class-elements/init-err-contains-super.case
+// - src/class-elements/initializer-error/cls-expr-fields-typeof.template
+/*---
+description: Syntax error if `super()` used in class field (typeof expression)
+esid: sec-class-definitions-static-semantics-early-errors
+features: [class, class-fields-public]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ Static Semantics: Early Errors
+
+ FieldDefinition:
+ PropertyNameInitializeropt
+
+ - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
+
+---*/
+
+
+$DONOTEVALUATE();
+
+var C = class {
+ x = typeof super();
+}
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-names.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-names.js
new file mode 100644
index 0000000000..d0e4c477cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-names.js
@@ -0,0 +1,96 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-names.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Computed property names (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = "b";
+
+
+
+var C = class {
+ ;;;;
+ ;;;;;;[x] = 42; [10] = "meep"; ["not initialized"];;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "10"),
+ "10 doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "10"),
+ "10 doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "10", {
+ value: "meep",
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "not initialized"),
+ "'not initialized' doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "not initialized", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-symbol-names.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-symbol-names.js
new file mode 100644
index 0000000000..5e24abd937
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-computed-symbol-names.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/computed-symbol-names.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Computed property symbol names (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, Symbol, computed-property-names, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+var x = Symbol();
+var y = Symbol();
+
+
+
+var C = class {
+ ;;;;
+ ;;;;;;[x]; [y] = 42;;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, x),
+ "Symbol x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, x),
+ "Symbol x doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, x, {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, y),
+ "Symbol y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, y),
+ "Symbol y doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, y, {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "x"),
+ "x doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "x"),
+ "x doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "x"),
+ "x doesn't appear as an own property on C instance"
+);
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "y"),
+ "y doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "y"),
+ "y doesn't appear as an own property on C constructor"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(c, "y"),
+ "y doesn't appear as an own property on C instance"
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js
new file mode 100644
index 0000000000..d69373afbc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: PrivateName Static Semantics, StringValue (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+
+ 1. Return the String value consisting of the sequence of code
+ units corresponding to PrivateName. In determining the sequence
+ any occurrences of \ UnicodeEscapeSequence are first replaced
+ with the code point represented by the UnicodeEscapeSequence
+ and then the code points of the entire PrivateName are converted
+ to code units by UTF16Encoding (10.1.1) each code point.
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#\u{6F};
+ #\u2118;
+ #ZW_\u200C_NJ;
+ #ZW_\u200D_J;;;;;;;;
+ ;;;;
+ o(value) {
+ this.#o = value;
+ return this.#o;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.o(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names-asi.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names-asi.js
new file mode 100644
index 0000000000..b42c272051
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names-asi.js
@@ -0,0 +1,66 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names-asi.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Literal property names with ASI (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;a
+ b = 42;;;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names.js
new file mode 100644
index 0000000000..3469c35032
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-literal-names.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/literal-names.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Literal property names (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+const fn = function() {}
+
+
+
+var C = class {
+ ;;;;
+ ;;;;;;a; b = 42;
+ c = fn;;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c doesn't appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c doesn't appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: fn,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-field-usage.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-field-usage.js
new file mode 100644
index 0000000000..32b81e5029
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-field-usage.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-field-usage.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: PrivateName CallExpression usage (private field) (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#m = 'test262';;;;;;;;
+ ;;;;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-getter-usage.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-getter-usage.js
new file mode 100644
index 0000000000..2d672155f7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-getter-usage.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-getter-usage.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: PrivateName CallExpression usage (Accesor get method) (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;get #m() { return 'test262'; };;;;;;;
+ ;;;;
+ method() {
+ return this.#m;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-usage.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-usage.js
new file mode 100644
index 0000000000..0f32fbc36f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-method-usage.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-method-usage.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: PrivateName CallExpression usage (private method) (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ Updated Productions
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await]
+ CallExpression[?Yield, ?Await].PrivateName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#m() { return 'test262'; };;;;;;;
+ ;;;;
+ method() {
+ return this.#m();
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.method(), 'test262');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-names.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-names.js
new file mode 100644
index 0000000000..0405b6a1b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-private-names.js
@@ -0,0 +1,59 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/private-names.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: private names (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#x; #y;;;;;;;
+ ;;;;
+ x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(c.x(), 42, "test 7");
+assert.sameValue(c.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier-initializer.js
new file mode 100644
index 0000000000..4f0d700fb8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier-initializer.js
@@ -0,0 +1,75 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid FieldDefinition (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;$ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier.js
new file mode 100644
index 0000000000..9ddc49a830
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-field-identifier.js
@@ -0,0 +1,82 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-field-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid FieldDefinition (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+
+ PropertyName :
+ LiteralPropertyName
+ ComputedPropertyName
+
+ LiteralPropertyName :
+ IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;$; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+c.$ = 1;
+c._ = 1;
+c.\u{6F} = 1;
+c.\u2118 = 1;
+c.ZW_\u200C_NJ = 1;
+c.ZW_\u200D_J = 1;
+
+assert.sameValue(c.$, 1);
+assert.sameValue(c._, 1);
+assert.sameValue(c.\u{6F}, 1);
+assert.sameValue(c.\u2118, 1);
+assert.sameValue(c.ZW_\u200C_NJ, 1);
+assert.sameValue(c.ZW_\u200D_J, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter-alt.js
new file mode 100644
index 0000000000..4c1ad59991
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter-alt.js
@@ -0,0 +1,116 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName as private getter (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #℘() {
+ return this.#℘_;
+ }
+ get #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ get #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter.js
new file mode 100644
index 0000000000..c465fe8398
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-getter.js
@@ -0,0 +1,116 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-getter.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName as private getter (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ get ClassElementName ( ){ FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ get #$() {
+ return this.#$_;
+ }
+ get #_() {
+ return this.#__;
+ }
+ get #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ get #\u2118() {
+ return this.#\u2118_;
+ }
+ get #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ get #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$_ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method-alt.js
new file mode 100644
index 0000000000..d2c1811fbc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method-alt.js
@@ -0,0 +1,115 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName as private method (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #℘() {
+ return this.#℘_;
+ }
+ #ZW_‌_NJ() {
+ return this.#ZW_‌_NJ_;
+ }
+ #ZW_‍_J() {
+ return this.#ZW_‍_J_;
+ }
+;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ ℘(value) {
+ this.#℘_ = value;
+ return this.#℘();
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ return this.#ZW_‌_NJ();
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ return this.#ZW_‍_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method.js
new file mode 100644
index 0000000000..4498bc2dd9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-method.js
@@ -0,0 +1,115 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-method.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName as private method (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ) { FunctionBody }
+ ...
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ #$() {
+ return this.#$_;
+ }
+ #_() {
+ return this.#__;
+ }
+ #\u{6F}() {
+ return this.#\u{6F}_;
+ }
+ #\u2118() {
+ return this.#\u2118_;
+ }
+ #ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ_;
+ }
+ #ZW_\u200D_J() {
+ return this.#ZW_\u200D_J_;
+ }
+;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$_ = value;
+ return this.#$();
+ }
+ _(value) {
+ this.#__ = value;
+ return this.#_();
+ }
+ \u{6F}(value) {
+ this.#\u{6F}_ = value;
+ return this.#\u{6F}();
+ }
+ \u2118(value) {
+ this.#\u2118_ = value;
+ return this.#\u2118();
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ return this.#ZW_\u200C_NJ();
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ return this.#ZW_\u200D_J();
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter-alt.js
new file mode 100644
index 0000000000..e7c974356d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter-alt.js
@@ -0,0 +1,115 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName as private setter (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$_; #__; #\u{6F}_; #℘_; #ZW_‌_NJ_; #ZW_‍_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #℘(value) {
+ this.#℘_ = value;
+ }
+ set #ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ_ = value;
+ }
+ set #ZW_‍_J(value) {
+ this.#ZW_‍_J_ = value;
+ }
+;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘_;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ_;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter.js
new file mode 100644
index 0000000000..e0893a60d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-private-setter.js
@@ -0,0 +1,115 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-private-setter.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName as private setter (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-methods-private, class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ ...
+ ;
+
+ MethodDefinition :
+ ...
+ set ClassElementName ( PropertySetParameterList ) { FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$_; #__; #\u{6F}_; #\u2118_; #ZW_\u200C_NJ_; #ZW_\u200D_J_;
+ set #$(value) {
+ this.#$_ = value;
+ }
+ set #_(value) {
+ this.#__ = value;
+ }
+ set #\u{6F}(value) {
+ this.#\u{6F}_ = value;
+ }
+ set #\u2118(value) {
+ this.#\u2118_ = value;
+ }
+ set #ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ_ = value;
+ }
+ set #ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J_ = value;
+ }
+;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$ = value;
+ return this.#$_;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#__;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F}_;
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118_;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ_;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J_;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-alt.js
new file mode 100644
index 0000000000..c92f4f1cd0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-alt.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ ℘(value) {
+ this.#℘ = value;
+ return this.#℘;
+ }
+ ZW_‌_NJ(value) {
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J(value) {
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.℘(1), 1);
+assert.sameValue(c.ZW_‌_NJ(1), 1);
+assert.sameValue(c.ZW_‍_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..d73a679729
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer-alt.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;;;;;;;
+ ;;;;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ ℘() {
+ return this.#℘;
+ }
+ ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.℘(), 1);
+assert.sameValue(c.ZW_‌_NJ(), 1);
+assert.sameValue(c.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..20a85b1d7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier-initializer.js
@@ -0,0 +1,91 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;;;;;;;
+ ;;;;
+ $() {
+ return this.#$;
+ }
+ _() {
+ return this.#_;
+ }
+ \u{6F}() {
+ return this.#\u{6F};
+ }
+ \u2118() {
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(), 1);
+assert.sameValue(c._(), 1);
+assert.sameValue(c.\u{6F}(), 1);
+assert.sameValue(c.\u2118(), 1);
+assert.sameValue(c.ZW_\u200C_NJ(), 1);
+assert.sameValue(c.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier.js
new file mode 100644
index 0000000000..bde1fcb3fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-privatename-identifier.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;#$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;;;;;;;
+ ;;;;
+ $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(c.$(1), 1);
+assert.sameValue(c._(1), 1);
+assert.sameValue(c.\u{6F}(1), 1);
+assert.sameValue(c.\u2118(1), 1);
+assert.sameValue(c.ZW_\u200C_NJ(1), 1);
+assert.sameValue(c.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..bb8d173798
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #o(value) {
+ yield * await value;
+ }
+ static async * #℘(value) {
+ yield * await value;
+ }
+ static async * #ZW_‌_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_‍_J(value) {
+ yield * await value;
+ };;;;;;;
+ ;;;;
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.o([1]).next(),
+ C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..423d092078
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static AsyncGeneratorMethod PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static async * #$(value) {
+ yield * await value;
+ }
+ static async * #_(value) {
+ yield * await value;
+ }
+ static async * #\u{6F}(value) {
+ yield * await value;
+ }
+ static async * #\u2118(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200C_NJ(value) {
+ yield * await value;
+ }
+ static async * #ZW_\u200D_J(value) {
+ yield * await value;
+ };;;;;;;
+ ;;;;
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$([1]).next(),
+ C._([1]).next(),
+ C.\u{6F}([1]).next(),
+ C.\u2118([1]).next(),
+ C.ZW_\u200C_NJ([1]).next(),
+ C.ZW_\u200D_J([1]).next(),
+]).then(results => {
+
+ assert.sameValue(results[0].value, 1);
+ assert.sameValue(results[1].value, 1);
+ assert.sameValue(results[2].value, 1);
+ assert.sameValue(results[3].value, 1);
+ assert.sameValue(results[4].value, 1);
+ assert.sameValue(results[5].value, 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..5d51d9379d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static AsyncMethod PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #o(value) {
+ return await value;
+ }
+ static async #℘(value) {
+ return await value;
+ }
+ static async #ZW_‌_NJ(value) {
+ return await value;
+ }
+ static async #ZW_‍_J(value) {
+ return await value;
+ };;;;;;;
+ ;;;;
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async o(value) {
+ return await this.#o(value);
+ }
+ static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#℘(value);
+ }
+ static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‌_NJ(value);
+ }
+ static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return await this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.o(1),
+ C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier.js
new file mode 100644
index 0000000000..73f8d2af38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-async-method-privatename-identifier.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-async-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static AsyncMethod PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated, async]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ AsyncMethod
+
+ AsyncMethod :
+ async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static async #$(value) {
+ return await value;
+ }
+ static async #_(value) {
+ return await value;
+ }
+ static async #\u{6F}(value) {
+ return await value;
+ }
+ static async #\u2118(value) {
+ return await value;
+ }
+ static async #ZW_\u200C_NJ(value) {
+ return await value;
+ }
+ static async #ZW_\u200D_J(value) {
+ return await value;
+ };;;;;;;
+ ;;;;
+ static async $(value) {
+ return await this.#$(value);
+ }
+ static async _(value) {
+ return await this.#_(value);
+ }
+ static async \u{6F}(value) {
+ return await this.#\u{6F}(value);
+ }
+ static async \u2118(value) {
+ return await this.#\u2118(value);
+ }
+ static async ZW_\u200C_NJ(value) {
+ return await this.#ZW_\u200C_NJ(value);
+ }
+ static async ZW_\u200D_J(value) {
+ return await this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+Promise.all([
+ C.$(1),
+ C._(1),
+ C.\u{6F}(1),
+ C.\u2118(1),
+ C.ZW_\u200C_NJ(1),
+ C.ZW_\u200D_J(1),
+]).then(results => {
+
+ assert.sameValue(results[0], 1);
+ assert.sameValue(results[1], 1);
+ assert.sameValue(results[2], 1);
+ assert.sameValue(results[3], 1);
+ assert.sameValue(results[4], 1);
+ assert.sameValue(results[5], 1);
+
+}).then($DONE, $DONE);
+
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..00277af4c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js
@@ -0,0 +1,112 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #o(value) {
+ yield * value;
+ }
+ static * #℘(value) {
+ yield * value;
+ }
+ static * #ZW_‌_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_‍_J(value) {
+ yield * value;
+ };;;;;;;
+ ;;;;
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get o() {
+ return this.#o;
+ }
+ static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘;
+ }
+ static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ;
+ }
+ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.o([1]).next().value, 1);
+assert.sameValue(C.℘([1]).next().value, 1);
+assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier.js
new file mode 100644
index 0000000000..b3edf7eb1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-generator-method-privatename-identifier.js
@@ -0,0 +1,113 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-generator-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static GeneratorMethod PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ GeneratorMethod
+
+ GeneratorMethod :
+ * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static * #$(value) {
+ yield * value;
+ }
+ static * #_(value) {
+ yield * value;
+ }
+ static * #\u{6F}(value) {
+ yield * value;
+ }
+ static * #\u2118(value) {
+ yield * value;
+ }
+ static * #ZW_\u200C_NJ(value) {
+ yield * value;
+ }
+ static * #ZW_\u200D_J(value) {
+ yield * value;
+ };;;;;;;
+ ;;;;
+ static get $() {
+ return this.#$;
+ }
+ static get _() {
+ return this.#_;
+ }
+ static get \u{6F}() {
+ return this.#\u{6F};
+ }
+ static get \u2118() {
+ return this.#\u2118;
+ }
+ static get ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static get ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$([1]).next().value, 1);
+assert.sameValue(C._([1]).next().value, 1);
+assert.sameValue(C.\u{6F}([1]).next().value, 1);
+assert.sameValue(C.\u2118([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1);
+assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier-alt.js
new file mode 100644
index 0000000000..f18d719ea5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier-alt.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static Method PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #o(value) {
+ return value;
+ }
+ static #℘(value) {
+ return value;
+ }
+ static #ZW_‌_NJ(value) {
+ return value;
+ }
+ static #ZW_‍_J(value) {
+ return value;
+ };;;;;;;
+ ;;;;
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static o(value) {
+ return this.#o(value);
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#℘(value);
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‌_NJ(value);
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ return this.#ZW_‍_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier.js
new file mode 100644
index 0000000000..b1139230fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-method-privatename-identifier.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-method-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static Method PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ MethodDefinition :
+ ClassElementName ( UniqueFormalParameters ){ FunctionBody }
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$(value) {
+ return value;
+ }
+ static #_(value) {
+ return value;
+ }
+ static #\u{6F}(value) {
+ return value;
+ }
+ static #\u2118(value) {
+ return value;
+ }
+ static #ZW_\u200C_NJ(value) {
+ return value;
+ }
+ static #ZW_\u200D_J(value) {
+ return value;
+ };;;;;;;
+ ;;;;
+ static $(value) {
+ return this.#$(value);
+ }
+ static _(value) {
+ return this.#_(value);
+ }
+ static \u{6F}(value) {
+ return this.#\u{6F}(value);
+ }
+ static \u2118(value) {
+ return this.#\u2118(value);
+ }
+ static ZW_\u200C_NJ(value) {
+ return this.#ZW_\u200C_NJ(value);
+ }
+ static ZW_\u200D_J(value) {
+ return this.#ZW_\u200D_J(value);
+ }
+
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js
new file mode 100644
index 0000000000..86e146f07f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;;
+ ;;;;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static o(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#℘ = value;
+ return C.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‌_NJ = value;
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ C.#ZW_‍_J = value;
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt.js
new file mode 100644
index 0000000000..36fac631fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-alt.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;;
+ ;;;;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static o(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#℘ = value;
+ return this.#℘;
+ }
+ static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‌_NJ = value;
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
+ this.#ZW_‍_J = value;
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.o(1), 1);
+assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-by-classname.js
new file mode 100644
index 0000000000..939dd0733b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-by-classname.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-by-classname.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;;
+ ;;;;
+ static $(value) {
+ C.#$ = value;
+ return C.#$;
+ }
+ static _(value) {
+ C.#_ = value;
+ return C.#_;
+ }
+ static \u{6F}(value) {
+ C.#\u{6F} = value;
+ return C.#\u{6F};
+ }
+ static \u2118(value) {
+ C.#\u2118 = value;
+ return C.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ C.#ZW_\u200C_NJ = value;
+ return C.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ C.#ZW_\u200D_J = value;
+ return C.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js
new file mode 100644
index 0000000000..f7b238395f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt-by-classname.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;;
+ ;;;;
+ static $() {
+ return C.#$;
+ }
+ static _() {
+ return C.#_;
+ }
+ static \u{6F}() {
+ return C.#\u{6F};
+ }
+ static ℘() {
+ return C.#℘;
+ }
+ static ZW_‌_NJ() {
+ return C.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return C.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js
new file mode 100644
index 0000000000..74e4c24154
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer-alt.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;;
+ ;;;;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static ℘() {
+ return this.#℘;
+ }
+ static ZW_‌_NJ() {
+ return this.#ZW_‌_NJ;
+ }
+ static ZW_‍_J() {
+ return this.#ZW_‍_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.℘(), 1);
+assert.sameValue(C.ZW_‌_NJ(), 1);
+assert.sameValue(C.ZW_‍_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer.js
new file mode 100644
index 0000000000..5346b0c288
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier-initializer.js
@@ -0,0 +1,92 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier-initializer.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;;;;;;;
+ ;;;;
+ static $() {
+ return this.#$;
+ }
+ static _() {
+ return this.#_;
+ }
+ static \u{6F}() {
+ return this.#\u{6F};
+ }
+ static \u2118() {
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ() {
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J() {
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(), 1);
+assert.sameValue(C._(), 1);
+assert.sameValue(C.\u{6F}(), 1);
+assert.sameValue(C.\u2118(), 1);
+assert.sameValue(C.ZW_\u200C_NJ(), 1);
+assert.sameValue(C.ZW_\u200D_J(), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier.js
new file mode 100644
index 0000000000..9df938406a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-rs-static-privatename-identifier.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/rs-static-privatename-identifier.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: Valid Static PrivateName (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+ static MethodDefinition
+ FieldDefinition ;
+ static FieldDefinition ;
+ ;
+
+ FieldDefinition :
+ ClassElementName Initializer _opt
+
+ ClassElementName :
+ PropertyName
+ PrivateName
+
+ PrivateName ::
+ # IdentifierName
+
+ IdentifierName ::
+ IdentifierStart
+ IdentifierName IdentifierPart
+
+ IdentifierStart ::
+ UnicodeIDStart
+ $
+ _
+ \ UnicodeEscapeSequence
+
+ IdentifierPart::
+ UnicodeIDContinue
+ $
+ \ UnicodeEscapeSequence
+ <ZWNJ> <ZWJ>
+
+ UnicodeIDStart::
+ any Unicode code point with the Unicode property "ID_Start"
+
+ UnicodeIDContinue::
+ any Unicode code point with the Unicode property "ID_Continue"
+
+
+ NOTE 3
+ The sets of code points with Unicode properties "ID_Start" and
+ "ID_Continue" include, respectively, the code points with Unicode
+ properties "Other_ID_Start" and "Other_ID_Continue".
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;;
+ ;;;;
+ static $(value) {
+ this.#$ = value;
+ return this.#$;
+ }
+ static _(value) {
+ this.#_ = value;
+ return this.#_;
+ }
+ static \u{6F}(value) {
+ this.#\u{6F} = value;
+ return this.#\u{6F};
+ }
+ static \u2118(value) {
+ this.#\u2118 = value;
+ return this.#\u2118;
+ }
+ static ZW_\u200C_NJ(value) {
+ this.#ZW_\u200C_NJ = value;
+ return this.#ZW_\u200C_NJ;
+ }
+ static ZW_\u200D_J(value) {
+ this.#ZW_\u200D_J = value;
+ return this.#ZW_\u200D_J;
+ }
+}
+
+var c = new C();
+
+assert.sameValue(C.$(1), 1);
+assert.sameValue(C._(1), 1);
+assert.sameValue(C.\u{6F}(1), 1);
+assert.sameValue(C.\u2118(1), 1);
+assert.sameValue(C.ZW_\u200C_NJ(1), 1);
+assert.sameValue(C.ZW_\u200D_J(1), 1);
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-fields.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-fields.js
new file mode 100644
index 0000000000..074de4187c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-fields.js
@@ -0,0 +1,59 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-fields.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: static private fields (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #x; static #y;;;;;;;
+ ;;;;
+ static x() {
+ this.#x = 42;
+ return this.#x;
+ }
+ static y() {
+ this.#y = 43;
+ return this.#y;
+ }
+}
+
+var c = new C();
+
+// Test the private fields do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 43, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods-with-fields.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods-with-fields.js
new file mode 100644
index 0000000000..f73085ecbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods-with-fields.js
@@ -0,0 +1,76 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods-with-fields.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: static private methods with fields (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class-static-fields-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;static #xVal; static #yVal;;;;;;;
+ ;;;;
+ static #x(value) {
+ this.#xVal = value;
+ return this.#xVal;
+ }
+ static #y(value) {
+ this.#yVal = value;
+ return this.#yVal;
+ }
+ static x() {
+ return this.#x(42);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#xVal"), "test 7");
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 8");
+assert(!Object.prototype.hasOwnProperty.call(c, "#xVal"), "test 9");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#yVal"), "test 10");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 11");
+assert(!Object.prototype.hasOwnProperty.call(c, "#yVal"), "test 12");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 13");
+assert.sameValue(C.y(), 43, "test 14");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 15");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 16");
+
+assert(!Object.prototype.hasOwnProperty.call(C, "#xVal"), "test 17");
+assert(!Object.prototype.hasOwnProperty.call(C, "#yVal"), "test 18");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods.js
new file mode 100644
index 0000000000..1100c5ef9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-static-private-methods.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/static-private-methods.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: static private methods (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-static-methods-private, class, class-fields-public]
+flags: [generated]
+info: |
+ ClassElement :
+ ...
+ static FieldDefinition ;
+
+ FieldDefinition :
+ ClassElementName Initializer_opt
+
+ ClassElementName :
+ PrivateName
+
+ PrivateName :
+ # IdentifierName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;;;;;;;;
+ ;;;;
+ static #x(value) {
+ return value / 2;
+ }
+ static #y(value) {
+ return value * 2;
+ }
+ static x() {
+ return this.#x(84);
+ }
+ static y() {
+ return this.#y(43);
+ }
+}
+
+var c = new C();
+
+// Test the private methods do not appear as properties before set to value
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#x"), "test 1");
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 2");
+assert(!Object.prototype.hasOwnProperty.call(c, "#x"), "test 3");
+
+assert(!Object.prototype.hasOwnProperty.call(C.prototype, "#y"), "test 4");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 5");
+assert(!Object.prototype.hasOwnProperty.call(c, "#y"), "test 6");
+
+// Test if private fields can be sucessfully accessed and set to value
+assert.sameValue(C.x(), 42, "test 7");
+assert.sameValue(C.y(), 86, "test 8");
+
+// Test the private fields do not appear as properties before after set to value
+assert(!Object.prototype.hasOwnProperty.call(C, "#x"), "test 9");
+assert(!Object.prototype.hasOwnProperty.call(C, "#y"), "test 10");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-string-literal-names.js b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-string-literal-names.js
new file mode 100644
index 0000000000..3e4d326660
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/elements/wrapped-in-sc-string-literal-names.js
@@ -0,0 +1,98 @@
+// This file was procedurally generated from the following sources:
+// - src/class-elements/string-literal-names.case
+// - src/class-elements/productions/cls-expr-wrapped-in-sc.template
+/*---
+description: String literal names (fields definition wrapped in semicolons)
+esid: prod-FieldDefinition
+features: [class-fields-public, class]
+flags: [generated]
+includes: [propertyHelper.js]
+info: |
+ ClassElement:
+ ...
+ FieldDefinition ;
+
+ FieldDefinition:
+ ClassElementName Initializer_opt
+
+ ClassElementName:
+ PropertyName
+
+---*/
+
+
+var C = class {
+ ;;;;
+ ;;;;;;'a'; "b"; 'c' = 39;
+ "d" = 42;;;;;;;
+ ;;;;
+
+}
+
+var c = new C();
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
+ "a does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "a"),
+ "a does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "a", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
+ "b does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "b"),
+ "b does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "b", {
+ value: undefined,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
+ "c does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "c"),
+ "c does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "c", {
+ value: 39,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+assert(
+ !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
+ "d does not appear as an own property on C prototype"
+);
+assert(
+ !Object.prototype.hasOwnProperty.call(C, "d"),
+ "d does not appear as an own property on C constructor"
+);
+
+verifyProperty(c, "d", {
+ value: 42,
+ enumerable: true,
+ writable: true,
+ configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-length-dflt.js b/js/src/tests/test262/language/expressions/class/gen-method-length-dflt.js
new file mode 100644
index 0000000000..f6803afeb1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-length-dflt.js
@@ -0,0 +1,61 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 14.1.6
+description: >
+ Default parameters' effect on function length
+info: |
+ Function length is counted by the non initialized parameters in the left.
+
+ 9.2.4 FunctionInitialize (F, kind, ParameterList, Body, Scope)
+
+ [...]
+ 2. Let len be the ExpectedArgumentCount of ParameterList.
+ 3. Perform ! DefinePropertyOrThrow(F, "length", PropertyDescriptor{[[Value]]:
+ len, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
+ [...]
+
+ FormalsList : FormalParameter
+
+ 1. If HasInitializer of FormalParameter is true return 0
+ 2. Return 1.
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let count be the ExpectedArgumentCount of FormalsList.
+ 2. If HasInitializer of FormalsList is true or HasInitializer of
+ FormalParameter is true, return count.
+ 3. Return count+1.
+features: [generators, default-parameters]
+includes: [propertyHelper.js]
+---*/
+
+var m1 = class { *m(x = 42) {} }.prototype.m;
+
+assert.sameValue(m1.length, 0, 'formalslist: x = 42');
+verifyNotEnumerable(m1, 'length');
+verifyNotWritable(m1, 'length');
+verifyConfigurable(m1, 'length');
+
+var m2 = class { *m(x = 42, y) {} }.prototype.m;
+
+assert.sameValue(m2.length, 0, 'formalslist: x = 42, y');
+verifyNotEnumerable(m2, 'length');
+verifyNotWritable(m2, 'length');
+verifyConfigurable(m2, 'length');
+
+var m3 = class { *m(x, y = 42) {} }.prototype.m;
+
+assert.sameValue(m3.length, 1, 'formalslist: x, y = 42');
+verifyNotEnumerable(m3, 'length');
+verifyNotWritable(m3, 'length');
+verifyConfigurable(m3, 'length');
+
+var m4 = class { *m(x, y = 42, z) {} }.prototype.m;
+
+assert.sameValue(m4.length, 1, 'formalslist: x, y = 42, z');
+verifyNotEnumerable(m4, 'length');
+verifyNotWritable(m4, 'length');
+verifyConfigurable(m4, 'length');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-param-dflt-yield.js b/js/src/tests/test262/language/expressions/class/gen-method-param-dflt-yield.js
new file mode 100644
index 0000000000..bb12e23c1c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-param-dflt-yield.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-generator-function-definitions
+es6id: 14.4
+description: >
+ YieldExpression cannot be used within the FormalParameters of a generator
+ function
+info: |
+ GeneratorMethod[Yield]:
+
+ * PropertyName[?Yield] ( StrictFormalParameters[Yield] ) { GeneratorBody }
+
+ YieldExpression cannot be used within the FormalParameters of a generator
+ function because any expressions that are part of FormalParameters are
+ evaluated before the resulting generator object is in a resumable state.
+features: [generators, default-parameters]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+0, class {
+ *g(x = yield) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/gen-method-static/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..f92a3e37fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/array-destructuring-param-strict-body.js
@@ -0,0 +1,159 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-gen-meth-static.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static *method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/browser.js b/js/src/tests/test262/language/expressions/class/gen-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-abrupt.js
new file mode 100644
index 0000000000..4920fb93fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-abrupt.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-gen-meth-static.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..58c92ec7d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-gen-meth-static.template
+/*---
+description: Use of initializer when argument value is not `undefined` (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ static *method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(false, '', NaN, 0, null, obj).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..d40b9205ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-arg-val-undefined.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-gen-meth-static.template
+/*---
+description: Use of initializer when argument value is `undefined` (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(undefined, void 0).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-duplicates.js
new file mode 100644
index 0000000000..4ae1049c88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-duplicates.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-gen-meth-static.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static *method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-later.js
new file mode 100644
index 0000000000..d6b9d37d38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-later.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-gen-meth-static.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static *method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..da088d30c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-prior.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-gen-meth-static.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static *method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+};
+
+C.method(3).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-self.js
new file mode 100644
index 0000000000..8e52c13f3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-ref-self.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-gen-meth-static.template
+/*---
+description: Referencing a parameter from within its own initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static *method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-rest.js
new file mode 100644
index 0000000000..241ec823c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-rest.js
@@ -0,0 +1,92 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-gen-meth-static.template
+/*---
+description: RestParameter does not support an initializer (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static *method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..0bce321b61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/dflt-params-trailing-comma.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(42, undefined, 1).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..787b16d07c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-gen-meth-static.template
+/*---
+description: Forbidden extension, f.arguments (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..0ddc30e4bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/cls-expr-gen-meth-static-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..0a263e7d9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..2c65574487
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..f930b3f44b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/cls-expr-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,63 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/gen-method-static/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..cc25805825
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/object-destructuring-param-strict-body.js
@@ -0,0 +1,159 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-gen-meth-static.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static *method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..50648217fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-multiple.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(42, 39, 1).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 2, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-single.js
new file mode 100644
index 0000000000..b7ee7161d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/params-trailing-comma-single.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(42, 39).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/gen-method-static/rest-param-strict-body.js
new file mode 100644
index 0000000000..d0e1cfb607
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/rest-param-strict-body.js
@@ -0,0 +1,159 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-gen-meth-static.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static *method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/gen-method-static/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..886341148c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-gen-meth-static.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static *method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/shell.js b/js/src/tests/test262/language/expressions/class/gen-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..7af8d9d38f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier-escaped.case
+// - src/generators/syntax/class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..71b7e09c83
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-binding-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier.case
+// - src/generators/syntax/class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..892dd7c9f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference-escaped.case
+// - src/generators/syntax/class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..6172877ff1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-identifier-reference.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference.case
+// - src/generators/syntax/class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..c8cd084b3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier-escaped.case
+// - src/generators/syntax/class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier.js
new file mode 100644
index 0000000000..b7d8adb96b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-as-label-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier.case
+// - src/generators/syntax/class-expr-static-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class { static *gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..fb3d06afe3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,54 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-spread-strict.case
+// - src/generators/default/class-expr-static-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [object-spread, generators]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class { static *gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..781945f8dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-identifier-strict-strict.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-strict.case
+// - src/generators/default/class-expr-static-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class { static *gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..52aa870694
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-multiple.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-multiple.case
+// - src/generators/default/class-expr-static-method.template
+/*---
+description: Use yield value in a array spread position (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+var callCount = 0;
+
+var C = class { static *gen() {
+ callCount += 1;
+ yield [...yield yield];
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+item = iter.next(item.value);
+
+assert.compareArray(item.value, arr);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-single.js
new file mode 100644
index 0000000000..e39b1b257e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-arr-single.js
@@ -0,0 +1,54 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-single.case
+// - src/generators/default/class-expr-static-method.template
+/*---
+description: Use yield value in a array spread position (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+---*/
+var arr = ['a', 'b', 'c'];
+
+var callCount = 0;
+
+var C = class { static *gen() {
+ callCount += 1;
+ yield [...yield];
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next(false);
+var item = iter.next(arr);
+var value = item.value;
+
+assert.notSameValue(value, arr, 'value is a new array');
+assert(Array.isArray(value), 'value is an Array exotic object');
+assert.sameValue(value.length, 3)
+assert.sameValue(value[0], 'a');
+assert.sameValue(value[1], 'b');
+assert.sameValue(value[2], 'c');
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-obj.js
new file mode 100644
index 0000000000..59efdcb5f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method-static/yield-spread-obj.js
@@ -0,0 +1,57 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-obj.case
+// - src/generators/default/class-expr-static-method.template
+/*---
+description: Use yield value in a object spread position (Static generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [object-spread, generators]
+flags: [generated]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+var callCount = 0;
+
+var C = class { static *gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+assert.sameValue(item.value.x, 42);
+assert.sameValue(item.value.y, 39);
+assert.sameValue(Object.keys(item.value).length, 2);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/gen-method/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..382571774f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/array-destructuring-param-strict-body.js
@@ -0,0 +1,159 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-gen-meth.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ *method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/browser.js b/js/src/tests/test262/language/expressions/class/gen-method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-abrupt.js
new file mode 100644
index 0000000000..7ae11fb838
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-abrupt.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-gen-meth.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..671666e723
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,114 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-gen-meth.template
+/*---
+description: Use of initializer when argument value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ *method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(false, '', NaN, 0, null, obj).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..601bc232b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-arg-val-undefined.js
@@ -0,0 +1,97 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-gen-meth.template
+/*---
+description: Use of initializer when argument value is `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(undefined, void 0).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-duplicates.js
new file mode 100644
index 0000000000..4dfd12d4b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-duplicates.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-gen-meth.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ *method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-later.js
new file mode 100644
index 0000000000..9bfbf71abc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-later.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-gen-meth.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ *method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..69cca8620b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-prior.js
@@ -0,0 +1,94 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-gen-meth.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ *method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(3).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-self.js
new file mode 100644
index 0000000000..daa861f73d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-ref-self.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-gen-meth.template
+/*---
+description: Referencing a parameter from within its own initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ *method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-rest.js
new file mode 100644
index 0000000000..c5b333e3df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-rest.js
@@ -0,0 +1,92 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-gen-meth.template
+/*---
+description: RestParameter does not support an initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ *method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..4c9c625f8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/dflt-params-trailing-comma.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-gen-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(42, undefined, 1).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..d760fdd8b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-gen-meth.template
+/*---
+description: Forbidden extension, f.arguments (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..42381b9c8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/cls-expr-gen-meth-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ *method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..6f347e6def
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.prototype.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..b59a856eb6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.prototype.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..94bd5da396
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/cls-expr-gen-meth-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-gen-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class, generators]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.prototype.method().next();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/gen-method/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..0839174212
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/object-destructuring-param-strict-body.js
@@ -0,0 +1,159 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-gen-meth.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ *method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..c204e8597f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-multiple.js
@@ -0,0 +1,89 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-gen-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(42, 39, 1).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 2, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-single.js
new file mode 100644
index 0000000000..3bd2c86926
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/params-trailing-comma-single.js
@@ -0,0 +1,88 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-gen-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(42, 39).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/gen-method/rest-param-strict-body.js
new file mode 100644
index 0000000000..969ed39077
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/rest-param-strict-body.js
@@ -0,0 +1,159 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-gen-meth.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ *method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/gen-method/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..90fed21dfe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,85 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-gen-meth.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ *method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/shell.js b/js/src/tests/test262/language/expressions/class/gen-method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..b23ff6b26a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier-escaped.case
+// - src/generators/syntax/class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..1c1f7fb97f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-binding-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-binding-identifier.case
+// - src/generators/syntax/class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ BindingIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..a300a44742
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference-escaped.case
+// - src/generators/syntax/class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..117f7ac3a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-identifier-reference.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-identifier-reference.case
+// - src/generators/syntax/class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ IdentifierReference : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..8ec9ddf683
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier-escaped.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier-escaped.case
+// - src/generators/syntax/class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier.js
new file mode 100644
index 0000000000..aeb8c22d37
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-as-label-identifier.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-as-label-identifier.case
+// - src/generators/syntax/class-expr-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ LabelIdentifier : Identifier
+
+ It is a Syntax Error if this production has a [Yield] parameter and
+ StringValue of Identifier is "yield".
+
+---*/
+$DONOTEVALUATE();
+
+var C = class {*gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..d726b13afa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,54 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-spread-strict.case
+// - src/generators/default/class-expr-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [object-spread, generators]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class {*gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..577563a951
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-identifier-strict-strict.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-identifier-strict.case
+// - src/generators/default/class-expr-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+var callCount = 0;
+
+var C = class {*gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..6e1fa9a34e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-multiple.js
@@ -0,0 +1,52 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-multiple.case
+// - src/generators/default/class-expr-method.template
+/*---
+description: Use yield value in a array spread position (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+var callCount = 0;
+
+var C = class {*gen() {
+ callCount += 1;
+ yield [...yield yield];
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+item = iter.next(item.value);
+
+assert.compareArray(item.value, arr);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-single.js
new file mode 100644
index 0000000000..3a34a9245c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-arr-single.js
@@ -0,0 +1,54 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-arr-single.case
+// - src/generators/default/class-expr-method.template
+/*---
+description: Use yield value in a array spread position (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [generators]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+---*/
+var arr = ['a', 'b', 'c'];
+
+var callCount = 0;
+
+var C = class {*gen() {
+ callCount += 1;
+ yield [...yield];
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next(false);
+var item = iter.next(arr);
+var value = item.value;
+
+assert.notSameValue(value, arr, 'value is a new array');
+assert(Array.isArray(value), 'value is an Array exotic object');
+assert.sameValue(value.length, 3)
+assert.sameValue(value[0], 'a');
+assert.sameValue(value[1], 'b');
+assert.sameValue(value[2], 'c');
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-obj.js
new file mode 100644
index 0000000000..930e769b68
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/gen-method/yield-spread-obj.js
@@ -0,0 +1,57 @@
+// This file was procedurally generated from the following sources:
+// - src/generators/yield-spread-obj.case
+// - src/generators/default/class-expr-method.template
+/*---
+description: Use yield value in a object spread position (Generator method as a ClassExpression element)
+esid: prod-GeneratorMethod
+features: [object-spread, generators]
+flags: [generated]
+info: |
+ ClassElement :
+ MethodDefinition
+
+ MethodDefinition :
+ GeneratorMethod
+
+ 14.4 Generator Function Definitions
+
+ GeneratorMethod :
+ * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+var callCount = 0;
+
+var C = class {*gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+}}
+
+var gen = C.prototype.gen;
+
+var iter = gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+assert.sameValue(item.value.x, 42);
+assert.sameValue(item.value.y, 39);
+assert.sameValue(Object.keys(item.value).length, 2);
+assert.sameValue(item.done, false);
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/getter-param-dflt.js b/js/src/tests/test262/language/expressions/class/getter-param-dflt.js
new file mode 100644
index 0000000000..2e326ff1da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/getter-param-dflt.js
@@ -0,0 +1,24 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-method-definitions
+es6id: 14.3
+description: >
+ Get accessor method may not have a formal parameter (regardless of the
+ presence of an initializer)
+info: |
+ Syntax
+
+ MethodDefinition[Yield] :
+
+ get PropertyName[?Yield] ( ) { FunctionBody }
+features: [default-parameters]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+0, class { get a(param = null) {} };
diff --git a/js/src/tests/test262/language/expressions/class/heritage-arrow-function.js b/js/src/tests/test262/language/expressions/class/heritage-arrow-function.js
new file mode 100644
index 0000000000..90ccbfcd32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/heritage-arrow-function.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ Throw a TypeError exception if IsConstructor(superclass) is false (async arrow)
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+
+ 5. Else,
+ Set the running execution context's LexicalEnvironment to classScope.
+ Let superclassRef be the result of evaluating ClassHeritage.
+ Set the running execution context's LexicalEnvironment to env.
+ Let superclass be ? GetValue(superclassRef).
+ If superclass is null, then
+ Let protoParent be null.
+ Let constructorParent be %Function.prototype%.
+ Else if IsConstructor(superclass) is false, throw a TypeError exception.
+ ...
+features: [class]
+---*/
+
+
+assert.throws(TypeError, () => {
+ var C = class extends (async () => {}) {};
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/heritage-async-arrow-function.js b/js/src/tests/test262/language/expressions/class/heritage-async-arrow-function.js
new file mode 100644
index 0000000000..90ccbfcd32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/heritage-async-arrow-function.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ Throw a TypeError exception if IsConstructor(superclass) is false (async arrow)
+info: |
+ Runtime Semantics: ClassDefinitionEvaluation
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+
+ 5. Else,
+ Set the running execution context's LexicalEnvironment to classScope.
+ Let superclassRef be the result of evaluating ClassHeritage.
+ Set the running execution context's LexicalEnvironment to env.
+ Let superclass be ? GetValue(superclassRef).
+ If superclass is null, then
+ Let protoParent be null.
+ Let constructorParent be %Function.prototype%.
+ Else if IsConstructor(superclass) is false, throw a TypeError exception.
+ ...
+features: [class]
+---*/
+
+
+assert.throws(TypeError, () => {
+ var C = class extends (async () => {}) {};
+});
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-break-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-break-escaped.js
new file mode 100644
index 0000000000..7728b37d15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-break-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/break-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: break is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ bre\u0061k() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['break'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-case-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-case-escaped.js
new file mode 100644
index 0000000000..644f2679b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-case-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/case-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: case is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ c\u0061se() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['case'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-catch-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-catch-escaped.js
new file mode 100644
index 0000000000..39b79bc09b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-catch-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/catch-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: catch is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ c\u0061tch() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['catch'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-class-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-class-escaped.js
new file mode 100644
index 0000000000..8a56065f2b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-class-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/class-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: class is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ cl\u0061ss() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['class'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-const-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-const-escaped.js
new file mode 100644
index 0000000000..b84f6e0c88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-const-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/const-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: const is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0063onst() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['const'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-continue-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-continue-escaped.js
new file mode 100644
index 0000000000..8318aee3da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-continue-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/continue-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: continue is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0063ontinue() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['continue'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-debugger-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-debugger-escaped.js
new file mode 100644
index 0000000000..a9093c0002
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-debugger-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/debugger-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: debugger is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0064ebugger() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['debugger'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped-ext.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped-ext.js
new file mode 100644
index 0000000000..8b72c1da35
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped-ext.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/default-escaped-ext.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: default is a valid identifier name, using extended escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ def\u{61}ult() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['default'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped.js
new file mode 100644
index 0000000000..5a83da04bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-default-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/default-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: default is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ def\u0061ult() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['default'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-default.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-default.js
new file mode 100644
index 0000000000..6056a90035
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-default.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/default.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: default is a valid identifier name (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ default() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['default'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-delete-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-delete-escaped.js
new file mode 100644
index 0000000000..d2d91de474
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-delete-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/delete-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: delete is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0064elete() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['delete'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-do-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-do-escaped.js
new file mode 100644
index 0000000000..beea4119cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-do-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/do-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: do is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0064o() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['do'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-else-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-else-escaped.js
new file mode 100644
index 0000000000..cc19d59c19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-else-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/else-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: else is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0065lse() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['else'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-enum-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-enum-escaped.js
new file mode 100644
index 0000000000..aed0920e94
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-enum-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/enum-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: enum is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0065num() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['enum'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-export-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-export-escaped.js
new file mode 100644
index 0000000000..5098b47cab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-export-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/export-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: export is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0065xport() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['export'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped-ext.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped-ext.js
new file mode 100644
index 0000000000..004091cc86
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped-ext.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/extends-escaped-ext.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: extends is a valid identifier name, using extended escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u{65}xtends() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['extends'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped.js
new file mode 100644
index 0000000000..7e5d5b6e21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/extends-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: extends is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0065xtends() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['extends'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends.js
new file mode 100644
index 0000000000..67f742372f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-extends.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/extends.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: extends is a valid identifier name (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ extends() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['extends'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-finally-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-finally-escaped.js
new file mode 100644
index 0000000000..22db29bb33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-finally-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/finally-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: finally is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0066inally() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['finally'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-for-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-for-escaped.js
new file mode 100644
index 0000000000..b1e6dccedd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-for-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/for-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: for is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0066or() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['for'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-function-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-function-escaped.js
new file mode 100644
index 0000000000..0aa78f81c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-function-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/function-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: function is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0066unction() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['function'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-if-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-if-escaped.js
new file mode 100644
index 0000000000..469cbcfbc1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-if-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/if-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: if is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ i\u0066() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['if'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-implements-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-implements-escaped.js
new file mode 100644
index 0000000000..e8164d219b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-implements-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/implements-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: implements is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0069mplements() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['implements'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-import-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-import-escaped.js
new file mode 100644
index 0000000000..b209229540
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-import-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/import-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: import is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0069mport() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['import'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-in-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-in-escaped.js
new file mode 100644
index 0000000000..d51e478c97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-in-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/in-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: in is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0069n() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['in'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-instanceof-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-instanceof-escaped.js
new file mode 100644
index 0000000000..4fd101347d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-instanceof-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/instanceof-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: instanceof is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ \u0069nstanceof() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['instanceof'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-interface-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-interface-escaped.js
new file mode 100644
index 0000000000..094fa28e09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-interface-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/interface-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: interface is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ interf\u0061ce() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['interface'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-let-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-let-escaped.js
new file mode 100644
index 0000000000..0b72d9c34c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-let-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/let-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: let is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ l\u0065t() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['let'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-new-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-new-escaped.js
new file mode 100644
index 0000000000..1105a76a56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-new-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/new-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: new is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ n\u0065w() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['new'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-package-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-package-escaped.js
new file mode 100644
index 0000000000..a746588bcf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-package-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/package-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: package is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ p\u0061ckage() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['package'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-private-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-private-escaped.js
new file mode 100644
index 0000000000..926ee4f6d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-private-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/private-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: private is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ privat\u0065() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['private'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-protected-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-protected-escaped.js
new file mode 100644
index 0000000000..9b1a7b7717
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-protected-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/protected-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: protected is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ prot\u0065cted() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['protected'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-public-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-public-escaped.js
new file mode 100644
index 0000000000..8d6d35974f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-public-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/public-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: public is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ pu\u0062lic() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['public'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-return-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-return-escaped.js
new file mode 100644
index 0000000000..9634da4360
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-return-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/return-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: return is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ r\u0065turn() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['return'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-static-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-static-escaped.js
new file mode 100644
index 0000000000..f91a09c7e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-static-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/static-escaped.case
+// - src/identifier-names/future-reserved-words/class-expression-method-def.template
+/*---
+description: static is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ st\u0061tic() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['static'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-super-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-super-escaped.js
new file mode 100644
index 0000000000..a9151506cb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-super-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/super-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: super is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ sup\u0065r() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['super'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-switch-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-switch-escaped.js
new file mode 100644
index 0000000000..990e87849f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-switch-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/switch-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: switch is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ sw\u0069tch() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['switch'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-this-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-this-escaped.js
new file mode 100644
index 0000000000..962dee47fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-this-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/this-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: this is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ th\u0069s() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['this'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-throw-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-throw-escaped.js
new file mode 100644
index 0000000000..cd041e5e46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-throw-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/throw-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: throw is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ t\u0068row() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['throw'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-try-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-try-escaped.js
new file mode 100644
index 0000000000..a0f8572092
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-try-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/try-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: try is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ tr\u0079() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['try'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-typeof-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-typeof-escaped.js
new file mode 100644
index 0000000000..0e4033d6cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-typeof-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/typeof-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: typeof is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ typ\u0065of() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['typeof'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-var-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-var-escaped.js
new file mode 100644
index 0000000000..23214d39e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-var-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/var-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: var is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ v\u0061r() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['var'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-void-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-void-escaped.js
new file mode 100644
index 0000000000..40bd00fda1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-void-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/void-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: void is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ voi\u0064() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['void'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-while-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-while-escaped.js
new file mode 100644
index 0000000000..7d2b5674d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-while-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/while-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: while is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ whil\u0065() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['while'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/ident-name-method-def-with-escaped.js b/js/src/tests/test262/language/expressions/class/ident-name-method-def-with-escaped.js
new file mode 100644
index 0000000000..6726825307
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/ident-name-method-def-with-escaped.js
@@ -0,0 +1,48 @@
+// This file was procedurally generated from the following sources:
+// - src/identifier-names/with-escaped.case
+// - src/identifier-names/default/class-expression-method-def.template
+/*---
+description: with is a valid identifier name, using escape (MethodDefinition)
+esid: prod-PropertyDefinition
+features: [class]
+flags: [generated]
+info: |
+ ObjectLiteral :
+ { PropertyDefinitionList }
+ { PropertyDefinitionList , }
+
+ PropertyDefinitionList:
+ PropertyDefinition
+ PropertyDefinitionList , PropertyDefinition
+
+ PropertyDefinition:
+ MethodDefinition
+ ...
+
+ MethodDefinition:
+ PropertyName ( UniqueFormalParameters ){ FunctionBody }
+
+ PropertyName:
+ LiteralPropertyName
+ ...
+
+ LiteralPropertyName:
+ IdentifierName
+ ...
+
+ Reserved Words
+
+ A reserved word is an IdentifierName that cannot be used as an Identifier.
+
+---*/
+
+
+var C = class {
+ w\u0069th() { return 42; }
+}
+
+var obj = new C();
+
+assert.sameValue(obj['with'](), 42, 'property exists');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-length-dflt.js b/js/src/tests/test262/language/expressions/class/method-length-dflt.js
new file mode 100644
index 0000000000..96df8cd60b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-length-dflt.js
@@ -0,0 +1,61 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 14.1.6
+description: >
+ Default parameters' effect on function length
+info: |
+ Function length is counted by the non initialized parameters in the left.
+
+ 9.2.4 FunctionInitialize (F, kind, ParameterList, Body, Scope)
+
+ [...]
+ 2. Let len be the ExpectedArgumentCount of ParameterList.
+ 3. Perform ! DefinePropertyOrThrow(F, "length", PropertyDescriptor{[[Value]]:
+ len, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
+ [...]
+
+ FormalsList : FormalParameter
+
+ 1. If HasInitializer of FormalParameter is true return 0
+ 2. Return 1.
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let count be the ExpectedArgumentCount of FormalsList.
+ 2. If HasInitializer of FormalsList is true or HasInitializer of
+ FormalParameter is true, return count.
+ 3. Return count+1.
+features: [default-parameters]
+includes: [propertyHelper.js]
+---*/
+
+var m1 = class { m(x = 42) {} }.prototype.m;
+
+assert.sameValue(m1.length, 0, 'formalslist: x = 42');
+verifyNotEnumerable(m1, 'length');
+verifyNotWritable(m1, 'length');
+verifyConfigurable(m1, 'length');
+
+var m2 = class { m(x = 42, y) {} }.prototype.m;
+
+assert.sameValue(m2.length, 0, 'formalslist: x = 42, y');
+verifyNotEnumerable(m2, 'length');
+verifyNotWritable(m2, 'length');
+verifyConfigurable(m2, 'length');
+
+var m3 = class { m(x, y = 42) {} }.prototype.m;
+
+assert.sameValue(m3.length, 1, 'formalslist: x, y = 42');
+verifyNotEnumerable(m3, 'length');
+verifyNotWritable(m3, 'length');
+verifyConfigurable(m3, 'length');
+
+var m4 = class { m(x, y = 42, z) {} }.prototype.m;
+
+assert.sameValue(m4.length, 1, 'formalslist: x, y = 42, z');
+verifyNotEnumerable(m4, 'length');
+verifyNotWritable(m4, 'length');
+verifyConfigurable(m4, 'length');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-param-dflt-yield.js b/js/src/tests/test262/language/expressions/class/method-param-dflt-yield.js
new file mode 100644
index 0000000000..340cb13359
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-param-dflt-yield.js
@@ -0,0 +1,23 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-method-definitions
+es6id: 14.3
+description: >
+ YieldExpression cannot be used within the FormalParameters of a class method
+info: |
+ MethodDefinition[Yield] :
+
+ PropertyName[?Yield] ( StrictFormalParameters ) { FunctionBody }
+features: [generators, default-parameters]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+0, class {
+ m(x = yield) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/method-static/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..4ffadd8f72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/array-destructuring-param-strict-body.js
@@ -0,0 +1,155 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-meth-static.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/browser.js b/js/src/tests/test262/language/expressions/class/method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-abrupt.js
new file mode 100644
index 0000000000..83b885004f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-abrupt.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-meth-static.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..eaae45c604
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-meth-static.template
+/*---
+description: Use of initializer when argument value is not `undefined` (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ static method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(false, '', NaN, 0, null, obj);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..6655922c05
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-arg-val-undefined.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-meth-static.template
+/*---
+description: Use of initializer when argument value is `undefined` (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(undefined, void 0);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-duplicates.js
new file mode 100644
index 0000000000..226d11a9d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-duplicates.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-meth-static.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-later.js
new file mode 100644
index 0000000000..5ed2b1b54b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-later.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-meth-static.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..eef892c675
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-prior.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-meth-static.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+};
+
+C.method(3);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-self.js
new file mode 100644
index 0000000000..95c4bbb6d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-ref-self.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-meth-static.template
+/*---
+description: Referencing a parameter from within its own initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-rest.js
new file mode 100644
index 0000000000..b9186cf9b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-rest.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-meth-static.template
+/*---
+description: RestParameter does not support an initializer (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..c6252c43c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/dflt-params-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(42, undefined, 1);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..b7d5acf676
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-meth-static.template
+/*---
+description: Forbidden extension, f.arguments (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..e748b6eae9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/cls-expr-meth-static-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..798184cc95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..616e9b95c5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..5e95123c09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/cls-expr-meth-static-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method-static/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/method-static/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..1dacd75052
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/object-destructuring-param-strict-body.js
@@ -0,0 +1,155 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-meth-static.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..bf0285a7ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-multiple.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(42, 39, 1);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 2, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-single.js
new file mode 100644
index 0000000000..0ff6e03bdf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/params-trailing-comma-single.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.method(42, 39);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method-static/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/method-static/rest-param-strict-body.js
new file mode 100644
index 0000000000..d681225e1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/rest-param-strict-body.js
@@ -0,0 +1,155 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-meth-static.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/method-static/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..21e13b2db6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,80 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-meth-static.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method-static/shell.js b/js/src/tests/test262/language/expressions/class/method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/method/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..69a5f04560
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/array-destructuring-param-strict-body.js
@@ -0,0 +1,155 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-meth.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method/browser.js b/js/src/tests/test262/language/expressions/class/method/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-abrupt.js
new file mode 100644
index 0000000000..80ef17afa2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-abrupt.js
@@ -0,0 +1,85 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-meth.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..3dbe3aab14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,110 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-meth.template
+/*---
+description: Use of initializer when argument value is not `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(false, '', NaN, 0, null, obj);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..2088270e24
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-arg-val-undefined.js
@@ -0,0 +1,93 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-meth.template
+/*---
+description: Use of initializer when argument value is `undefined` (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(undefined, void 0);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-duplicates.js
new file mode 100644
index 0000000000..30e6337dd3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-duplicates.js
@@ -0,0 +1,84 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-meth.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-later.js
new file mode 100644
index 0000000000..ab2724b0fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-later.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-meth.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..fec59950f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-prior.js
@@ -0,0 +1,90 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-meth.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(3);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-self.js
new file mode 100644
index 0000000000..69d6f193da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-ref-self.js
@@ -0,0 +1,86 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-meth.template
+/*---
+description: Referencing a parameter from within its own initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.prototype.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-rest.js
new file mode 100644
index 0000000000..236497491c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-rest.js
@@ -0,0 +1,88 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-meth.template
+/*---
+description: RestParameter does not support an initializer (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/method/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..a2859b382a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/dflt-params-trailing-comma.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(42, undefined, 1);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..1fbf315541
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-meth.template
+/*---
+description: Forbidden extension, f.arguments (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..decb13378a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/cls-expr-meth-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,37 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.prototype.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..eaeb5677da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.prototype.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..e5e8332971
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.prototype.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..5e109e3330
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/cls-expr-meth-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,64 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-meth.template
+/*---
+description: Forbidden extension, o.caller (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [class]
+flags: [generated, noStrict]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+
+ callCount++;
+ }
+};
+
+C.prototype.method();
+assert.sameValue(callCount, 1, 'method body evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/method/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/method/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/method/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..4524a9ce78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/object-destructuring-param-strict-body.js
@@ -0,0 +1,155 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-meth.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/method/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..fe77a1e8bc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/params-trailing-comma-multiple.js
@@ -0,0 +1,84 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(42, 39, 1);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 2, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/method/params-trailing-comma-single.js
new file mode 100644
index 0000000000..4812bb84e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/params-trailing-comma-single.js
@@ -0,0 +1,83 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-meth.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(42, 39);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+assert.sameValue(ref.length, 1, 'length is properly set');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/method/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/method/rest-param-strict-body.js
new file mode 100644
index 0000000000..a1ab4df1b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/rest-param-strict-body.js
@@ -0,0 +1,155 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-meth.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/method/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..c38a3ca80a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,80 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-meth.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/method/shell.js b/js/src/tests/test262/language/expressions/class/method/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/method/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/name.js b/js/src/tests/test262/language/expressions/class/name.js
new file mode 100644
index 0000000000..f3a3ae912f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/name.js
@@ -0,0 +1,56 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-class-definitions-runtime-semantics-evaluation
+description: Assignment of function `name` attribute
+info: |
+ ClassExpression : class ClassTail
+
+ 1. Let value be ? ClassDefinitionEvaluation of ClassTail with arguments
+ undefined and "".
+ ...
+ 4. Return value.
+
+ ClassExpression : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be ? ClassDefinitionEvaluation of ClassTail with arguments
+ className and className.
+ ...
+ 4. Return value.
+
+ 14.6.13 Runtime Semantics: ClassDefinitionEvaluation
+
+ ...
+ 12. Let constructorInfo be DefineMethod of constructor with arguments proto,
+ className as the optional name argument, and constructorParent.
+ ...
+
+ 14.3.7 Runtime Semantics: DefineMethod
+
+ ...
+ 7. Let closure be FunctionCreate(kind, UniqueFormalParameters, FunctionBody,
+ scope, name, prototype).
+ ...
+
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(class {}, "name", {
+ value: "", writable: false, enumerable: false, configurable: true
+});
+
+verifyProperty(class cls {}, "name", {
+ value: "cls", writable: false, enumerable: false, configurable: true
+});
+
+verifyProperty(class { constructor() {} }, "name", {
+ value: "", writable: false, enumerable: false, configurable: true
+});
+
+verifyProperty(class cls { constructor() {} }, "name", {
+ value: "cls", writable: false, enumerable: false, configurable: true
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-args-unmapped.js b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-args-unmapped.js
new file mode 100644
index 0000000000..dd31dc4761
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-args-unmapped.js
@@ -0,0 +1,108 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [generators, default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(x, _ = 0) {
+ assert.sameValue(x, undefined, 'parameter binding value (initial)');
+ assert.sameValue(
+ arguments[0], undefined, 'arguments property value (initial)'
+ );
+
+ arguments[0] = 1;
+
+ assert.sameValue(
+ x, undefined, 'parameter binding value (after arguments modification)'
+ );
+ assert.sameValue(
+ arguments[0], 1, 'arguments property value (after arguments modification)'
+ );
+
+ x = 2;
+
+ assert.sameValue(
+ x, 2, 'parameter binding value (after parameter binding modification)'
+ );
+ assert.sameValue(
+ arguments[0],
+ 1,
+ 'arguments property value (after parameter binding modification)'
+ );
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method().next();
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-ref-arguments.js b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-ref-arguments.js
new file mode 100644
index 0000000000..b5a94abead
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-ref-arguments.js
@@ -0,0 +1,87 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [generators, default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(x = arguments[2], y = arguments[3], z) {
+ assert.sameValue(x, 'third', 'first parameter');
+ assert.sameValue(y, 'fourth', 'second parameter');
+ assert.sameValue(z, 'third', 'third parameter');
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(undefined, undefined, 'third', 'fourth').next();
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-args-unmapped.js b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-args-unmapped.js
new file mode 100644
index 0000000000..c3d22a3c65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-args-unmapped.js
@@ -0,0 +1,108 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [generators, default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(x, _ = 0) {
+ assert.sameValue(x, undefined, 'parameter binding value (initial)');
+ assert.sameValue(
+ arguments[0], undefined, 'arguments property value (initial)'
+ );
+
+ arguments[0] = 1;
+
+ assert.sameValue(
+ x, undefined, 'parameter binding value (after arguments modification)'
+ );
+ assert.sameValue(
+ arguments[0], 1, 'arguments property value (after arguments modification)'
+ );
+
+ x = 2;
+
+ assert.sameValue(
+ x, 2, 'parameter binding value (after parameter binding modification)'
+ );
+ assert.sameValue(
+ arguments[0],
+ 1,
+ 'arguments property value (after parameter binding modification)'
+ );
+ callCount = callCount + 1;
+ }
+};
+
+C.method().next();
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-ref-arguments.js b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-ref-arguments.js
new file mode 100644
index 0000000000..aa513126e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-gen-meth-static-ref-arguments.js
@@ -0,0 +1,87 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (static class expression generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [generators, default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(x = arguments[2], y = arguments[3], z) {
+ assert.sameValue(x, 'third', 'first parameter');
+ assert.sameValue(y, 'fourth', 'second parameter');
+ assert.sameValue(z, 'third', 'third parameter');
+ callCount = callCount + 1;
+ }
+};
+
+C.method(undefined, undefined, 'third', 'fourth').next();
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-meth-args-unmapped.js b/js/src/tests/test262/language/expressions/class/params-dflt-meth-args-unmapped.js
new file mode 100644
index 0000000000..cf79e567ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-meth-args-unmapped.js
@@ -0,0 +1,105 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method(x, _ = 0) {
+ assert.sameValue(x, undefined, 'parameter binding value (initial)');
+ assert.sameValue(
+ arguments[0], undefined, 'arguments property value (initial)'
+ );
+
+ arguments[0] = 1;
+
+ assert.sameValue(
+ x, undefined, 'parameter binding value (after arguments modification)'
+ );
+ assert.sameValue(
+ arguments[0], 1, 'arguments property value (after arguments modification)'
+ );
+
+ x = 2;
+
+ assert.sameValue(
+ x, 2, 'parameter binding value (after parameter binding modification)'
+ );
+ assert.sameValue(
+ arguments[0],
+ 1,
+ 'arguments property value (after parameter binding modification)'
+ );
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method();
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-meth-ref-arguments.js b/js/src/tests/test262/language/expressions/class/params-dflt-meth-ref-arguments.js
new file mode 100644
index 0000000000..81521fa2d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-meth-ref-arguments.js
@@ -0,0 +1,84 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ method(x = arguments[2], y = arguments[3], z) {
+ assert.sameValue(x, 'third', 'first parameter');
+ assert.sameValue(y, 'fourth', 'second parameter');
+ assert.sameValue(z, 'third', 'third parameter');
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(undefined, undefined, 'third', 'fourth');
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-meth-static-args-unmapped.js b/js/src/tests/test262/language/expressions/class/params-dflt-meth-static-args-unmapped.js
new file mode 100644
index 0000000000..a6641fb563
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-meth-static-args-unmapped.js
@@ -0,0 +1,105 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(x, _ = 0) {
+ assert.sameValue(x, undefined, 'parameter binding value (initial)');
+ assert.sameValue(
+ arguments[0], undefined, 'arguments property value (initial)'
+ );
+
+ arguments[0] = 1;
+
+ assert.sameValue(
+ x, undefined, 'parameter binding value (after arguments modification)'
+ );
+ assert.sameValue(
+ arguments[0], 1, 'arguments property value (after arguments modification)'
+ );
+
+ x = 2;
+
+ assert.sameValue(
+ x, 2, 'parameter binding value (after parameter binding modification)'
+ );
+ assert.sameValue(
+ arguments[0],
+ 1,
+ 'arguments property value (after parameter binding modification)'
+ );
+ callCount = callCount + 1;
+ }
+};
+
+C.method();
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/params-dflt-meth-static-ref-arguments.js b/js/src/tests/test262/language/expressions/class/params-dflt-meth-static-ref-arguments.js
new file mode 100644
index 0000000000..c50c7810a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/params-dflt-meth-static-ref-arguments.js
@@ -0,0 +1,84 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Referencing the arguments object from a default parameter (static class expression method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+es6id: 14.5.16
+features: [default-parameters]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(x = arguments[2], y = arguments[3], z) {
+ assert.sameValue(x, 'third', 'first parameter');
+ assert.sameValue(y, 'fourth', 'second parameter');
+ assert.sameValue(z, 'third', 'third parameter');
+ callCount = callCount + 1;
+ }
+};
+
+C.method(undefined, undefined, 'third', 'fourth');
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/poisoned-underscore-proto.js b/js/src/tests/test262/language/expressions/class/poisoned-underscore-proto.js
new file mode 100644
index 0000000000..b27de560b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/poisoned-underscore-proto.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2019 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: prod-ClassExpression
+description: >
+ ClassExpression should directly set [[Prototype]] internal slot.
+info: |
+ ClassDefinitionEvaluation
+
+ [...]
+ 7. Let proto be ObjectCreate(protoParent).
+
+ ObjectCreate ( proto [ , internalSlotsList ] )
+
+ [...]
+ 4. Set obj.[[Prototype]] to proto.
+features: [class, __proto__]
+---*/
+
+Object.defineProperty(Object.prototype, '__proto__', {
+ set: function() {
+ throw new Test262Error('should not be called');
+ },
+});
+
+var A = class extends Array {};
+
+assert.sameValue(new A(1).length, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..ffe5870538
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private getter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ get #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m;
+ }
+}
+)`;
+
+let createAndInstantiateClass = function (_eval) {
+ return new (_eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass(eval);
+let c2 = createAndInstantiateClass(eval);
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval.js b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval.js
new file mode 100644
index 0000000000..f8cf15c9ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-eval.js
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private getter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ get #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m;
+ }
+}
+)`;
+
+let createAndInstantiateClass = function () {
+ return new (eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..18a5b690a3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,49 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private getter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+---*/
+
+let createAndInstantiateClass = function () {
+ const C = class {
+ get #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m;
+ }
+ }
+
+ let c = new C();
+ return c;
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..531d435480
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,52 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private getter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+---*/
+
+let classStringExpression = `
+return class {
+ get #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m;
+ }
+}
+`;
+
+let createAndInstantiateClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ let Class = classFactoryFunction();
+ return new Class();
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js
new file mode 100644
index 0000000000..e31d0cf9b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js
@@ -0,0 +1,55 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private getter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private, cross-realm]
+---*/
+
+let classStringExpression = `
+return class {
+ get #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m;
+ }
+}
+`;
+
+let createAndInstantiateClass = function () {
+ let realm = $262.createRealm();
+ let classFactoryFunction = new (realm.global.Function)(classStringExpression);
+ let Class = classFactoryFunction();
+ let obj = new Class();
+ obj.realm = realm;
+ return obj;
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(c1.realm.global.TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(c2.realm.global.TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..e09ce11af1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-getter-brand-check-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,56 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private getter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let realm1 = $262.createRealm();
+let realm2 = $262.createRealm();
+let eval1 = realm1.global.eval;
+let eval2 = realm2.global.eval;
+
+let classStringExpression = `(
+class {
+ get #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m;
+ }
+}
+)`;
+
+let createAndInstantiateClass = function (_eval) {
+ return new (_eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass(eval1);
+let c2 = createAndInstantiateClass(eval2);
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(realm1.global.TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(realm2.global.TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..8147cbb9f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private method)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class C {
+ #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m();
+ }
+}
+)`;
+
+let createAndInstantiateClass = function (_eval) {
+ return new (_eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass(eval);
+let c2 = createAndInstantiateClass(eval);
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval.js b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval.js
new file mode 100644
index 0000000000..e2334ff07e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-eval.js
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private method)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class C {
+ #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m();
+ }
+}
+)`;
+
+let createAndInstantiateClass = function () {
+ return new (eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..1107fe9e74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,48 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private method)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+---*/
+
+let createAndInstantiateClass = function () {
+ const C = class {
+ #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m();
+ }
+ }
+
+ return new C();
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..e8015aa527
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,52 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private method)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+---*/
+
+let classStringExpression = `
+return class C {
+ #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m();
+ }
+}
+`;
+
+let createAndInstantiateClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ let Class = classFactoryFunction();
+ return new Class();
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm-function-ctor.js
new file mode 100644
index 0000000000..d7e38435ab
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm-function-ctor.js
@@ -0,0 +1,55 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private method)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private, cross-realm]
+---*/
+
+let classStringExpression = `
+return class C {
+ #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m();
+ }
+}
+`;
+
+let createAndInstantiateClass = function () {
+ let realm = $262.createRealm();
+ let classFactoryFunction = new (realm.global.Function)(classStringExpression);
+ let Class = classFactoryFunction();
+ let obj = new Class();
+ obj.realm = realm;
+ return obj;
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(c1.realm.global.TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(c2.realm.global.TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..88949b923b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-method-brand-check-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,56 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private method)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let realm1 = $262.createRealm();
+let realm2 = $262.createRealm();
+let eval1 = realm1.global.eval;
+let eval2 = realm2.global.eval;
+
+let classStringExpression = `(
+class {
+ #m() { return 'test262'; }
+
+ access(o) {
+ return o.#m();
+ }
+}
+)`;
+
+let createAndInstantiateClass = function (_eval) {
+ return new (_eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass(eval1);
+let c2 = createAndInstantiateClass(eval2);
+
+assert.sameValue(c1.access(c1), 'test262');
+assert.sameValue(c2.access(c2), 'test262');
+
+assert.throws(realm1.global.TypeError, function() {
+ c1.access(c2);
+}, 'invalid access of c1 private method');
+
+assert.throws(realm2.global.TypeError, function() {
+ c2.access(c1);
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..48438a9e97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,53 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private setter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ set #m(v) { this._v = v; }
+
+ access(o, v) {
+ o.#m = v;
+ }
+}
+)`;
+
+let createAndInstantiateClass = function (_eval) {
+ return new (_eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass(eval);
+let c2 = createAndInstantiateClass(eval);
+
+c1.access(c1, 'test262');
+assert.sameValue(c1._v, 'test262');
+c2.access(c2, 'test262');
+assert.sameValue(c2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2, 'foo');
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1, 'foo');
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval.js b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval.js
new file mode 100644
index 0000000000..d763af7cfe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-eval.js
@@ -0,0 +1,53 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private setter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ set #m(v) { this._v = v; }
+
+ access(o, v) {
+ o.#m = v;
+ }
+}
+)`;
+
+let createAndInstantiateClass = function () {
+ return new (eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+c1.access(c1, 'test262');
+assert.sameValue(c1._v, 'test262');
+c2.access(c2, 'test262');
+assert.sameValue(c2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2, 'foo');
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1, 'foo');
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..80ec752d1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,50 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private setter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+---*/
+
+let createAndInstantiateClass = function () {
+ const C = class {
+ set #m(v) { this._v = v; }
+
+ access(o, v) {
+ o.#m = v;
+ }
+ }
+
+ return new C();
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+c1.access(c1, 'test262');
+assert.sameValue(c1._v, 'test262');
+c2.access(c2, 'test262');
+assert.sameValue(c2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2, 'foo');
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1, 'foo');
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..08bddbae91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,54 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private setter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private]
+---*/
+
+let classStringExpression = `
+return class {
+ set #m(v) { this._v = v; }
+
+ access(o, v) {
+ o.#m = v;
+ }
+}
+`;
+
+let createAndInstantiateClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ let Class = classFactoryFunction();
+ return new Class();
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+c1.access(c1, 'test262');
+assert.sameValue(c1._v, 'test262');
+c2.access(c2, 'test262');
+assert.sameValue(c2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ c1.access(c2, 'foo');
+}, 'invalid access of c1 private method');
+
+assert.throws(TypeError, function() {
+ c2.access(c1, 'foo');
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js
new file mode 100644
index 0000000000..ffd9b1665b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm-function-ctor.js
@@ -0,0 +1,57 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private setter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private, cross-realm]
+---*/
+
+let classStringExpression = `
+return class {
+ set #m(v) { this._v = v; }
+
+ access(o, v) {
+ o.#m = v;
+ }
+}
+`;
+
+let createAndInstantiateClass = function () {
+ let realm = $262.createRealm();
+ let classFactoryFunction = new (realm.global.Function)(classStringExpression);
+ let Class = classFactoryFunction();
+ let obj = new Class();
+ obj.realm = realm;
+ return obj;
+};
+
+let c1 = createAndInstantiateClass();
+let c2 = createAndInstantiateClass();
+
+c1.access(c1, 'test262');
+assert.sameValue(c1._v, 'test262');
+c2.access(c2, 'test262');
+assert.sameValue(c2._v, 'test262');
+
+assert.throws(c1.realm.global.TypeError, function() {
+ c1.access(c2, 'foo');
+}, 'invalid access of c1 private method');
+
+assert.throws(c2.realm.global.TypeError, function() {
+ c2.access(c1, 'foo');
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..cb127d61b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-setter-brand-check-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,58 @@
+// Copyright (C) 2019 Jaideep Bhoosreddy (Bloomberg LP). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private setter)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 11. Let proto be ObjectCreate(protoParent).
+ ...
+ 31. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that the P's [[Kind]] field is either "method" or "accessor",
+ a. Set F.[[PrivateBrand]] to proto.
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-methods-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let realm1 = $262.createRealm();
+let realm2 = $262.createRealm();
+let eval1 = realm1.global.eval;
+let eval2 = realm2.global.eval;
+
+let classStringExpression = `(
+class {
+ set #m(v) { this._v = v; }
+
+ access(o, v) {
+ o.#m = v;
+ }
+}
+)`;
+
+let createAndInstantiateClass = function (_eval) {
+ return new (_eval(classStringExpression));
+};
+
+let c1 = createAndInstantiateClass(eval1);
+let c2 = createAndInstantiateClass(eval2);
+
+c1.access(c1, 'test262');
+assert.sameValue(c1._v, 'test262');
+c2.access(c2, 'test262');
+assert.sameValue(c2._v, 'test262');
+
+assert.throws(realm1.global.TypeError, function() {
+ c1.access(c2, 'foo');
+}, 'invalid access of c1 private method');
+
+assert.throws(realm2.global.TypeError, function() {
+ c2.access(c1, 'foo');
+}, 'invalid access of c2 private method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-direct-eval.js b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-direct-eval.js
new file mode 100644
index 0000000000..f312d90898
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-direct-eval.js
@@ -0,0 +1,70 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static field)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassElementName : PrivateIdentifier
+ 1. Let privateIdentifier be StringValue of PrivateIdentifier.
+ 2. Let privateName be NewPrivateName(privateIdentifier).
+ 3. Let scope be the running execution context's PrivateEnvironment.
+ 4. Let scopeEnvRec be scope's EnvironmentRecord.
+ 5. Perform ! scopeEnvRec.InitializeBinding(privateIdentifier, privateName).
+ 6. Return privateName.
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+ ...
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ ...
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+features: [class, class-static-fields-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static #m = 'test262';
+
+ static access() {
+ return this.#m;
+ }
+}
+)`;
+
+let evalClass = function () {
+ return eval(classStringExpression);
+};
+
+let C1 = evalClass();
+let C2 = evalClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static field');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static field');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..3b37db3ea9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,70 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static field)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassElementName : PrivateIdentifier
+ 1. Let privateIdentifier be StringValue of PrivateIdentifier.
+ 2. Let privateName be NewPrivateName(privateIdentifier).
+ 3. Let scope be the running execution context's PrivateEnvironment.
+ 4. Let scopeEnvRec be scope's EnvironmentRecord.
+ 5. Perform ! scopeEnvRec.InitializeBinding(privateIdentifier, privateName).
+ 6. Return privateName.
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+ ...
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ ...
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+features: [class, class-static-fields-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static #m = 'test262';
+
+ static access() {
+ return this.#m;
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval);
+let C2 = evalClass(eval);
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static field');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static field');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..a8efd743b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,65 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static field)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassElementName : PrivateIdentifier
+ 1. Let privateIdentifier be StringValue of PrivateIdentifier.
+ 2. Let privateName be NewPrivateName(privateIdentifier).
+ 3. Let scope be the running execution context's PrivateEnvironment.
+ 4. Let scopeEnvRec be scope's EnvironmentRecord.
+ 5. Perform ! scopeEnvRec.InitializeBinding(privateIdentifier, privateName).
+ 6. Return privateName.
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+ ...
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ ...
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+features: [class, class-static-fields-private]
+---*/
+
+let createClass = function () {
+ return class {
+ static #m = 'test262';
+
+ static access() {
+ return this.#m;
+ }
+ }
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static field');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static field');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..d2e571c6f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,70 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static field)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassElementName : PrivateIdentifier
+ 1. Let privateIdentifier be StringValue of PrivateIdentifier.
+ 2. Let privateName be NewPrivateName(privateIdentifier).
+ 3. Let scope be the running execution context's PrivateEnvironment.
+ 4. Let scopeEnvRec be scope's EnvironmentRecord.
+ 5. Perform ! scopeEnvRec.InitializeBinding(privateIdentifier, privateName).
+ 6. Return privateName.
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+ ...
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ ...
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+features: [class, class-static-fields-private]
+---*/
+
+let classStringExpression = `
+return class {
+ static #m = 'test262';
+
+ static access() {
+ return this.#m;
+ }
+}
+`;
+
+let createClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ return classFactoryFunction();
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static field');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static field');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..94348c45ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-field-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,75 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static field)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassElementName : PrivateIdentifier
+ 1. Let privateIdentifier be StringValue of PrivateIdentifier.
+ 2. Let privateName be NewPrivateName(privateIdentifier).
+ 3. Let scope be the running execution context's PrivateEnvironment.
+ 4. Let scopeEnvRec be scope's EnvironmentRecord.
+ 5. Perform ! scopeEnvRec.InitializeBinding(privateIdentifier, privateName).
+ 6. Return privateName.
+
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 27. Let staticFields be a new empty List.
+ 28. For each ClassElement e in order from elements,
+ a. If IsStatic of e is false, then
+ ...
+ b. Else,
+ i. Let field be the result of performing PropertyDefinitionEvaluation for m ClassElementEvaluation for e with arguments F and false.
+ c. If field is an abrupt completion, then
+ ...
+ d. If field is not empty,
+ i. If IsStatic of e is false, append field to instanceFields.
+ ii. Otherwise, append field to staticFields.
+ ...
+ 34. For each item fieldRecord in order from staticFields,
+ a. Perform ? DefineField(F, field).
+ ...
+
+ DefineField(receiver, fieldRecord)
+ ...
+ 8. If fieldName is a Private Name,
+ a. Perform ? PrivateFieldAdd(fieldName, receiver, initValue).
+features: [class, class-static-fields-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let global1 = $262.createRealm().global;
+let global2 = $262.createRealm().global;
+let eval1 = global1.eval;
+let eval2 = global2.eval;
+
+let classStringExpression = `(
+class {
+ static #m = 'test262';
+
+ static access() {
+ return this.#m;
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval1);
+let C2 = evalClass(eval2);
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(global1.TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static field');
+
+assert.throws(global2.TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static field');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-direct-eval.js b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-direct-eval.js
new file mode 100644
index 0000000000..6f62df7505
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-direct-eval.js
@@ -0,0 +1,56 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static getter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static get #m() {
+ return 'Test262';
+ };
+
+ static access() {
+ return this.#m;
+ }
+}
+)`;
+
+let evalClass = function () {
+ return eval(classStringExpression);
+};
+
+let C1 = evalClass();
+let C2 = evalClass();
+
+assert.sameValue(C1.access(), 'Test262');
+assert.sameValue(C2.access(), 'Test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static getter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static getter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..96c34a9a38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,56 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static getter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static get #m() {
+ return 'test262';
+ };
+
+ static access() {
+ return this.#m;
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval);
+let C2 = evalClass(eval);
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static getter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static getter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..6fd36824a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static getter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+---*/
+
+let createClass = function () {
+ return class {
+ static get #m() {
+ return 'test262';
+ };
+
+ static access() {
+ return this.#m;
+ }
+ }
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static getter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static getter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..92eee80519
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,56 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static getter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+---*/
+
+let classStringExpression = `
+return class {
+ static get #m() {
+ return 'test262';
+ };
+
+ static access() {
+ return this.#m;
+ }
+}
+`;
+
+let createClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ return classFactoryFunction();
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static getter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static getter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..e55fee402f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-getter-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,61 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static getter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let global1 = $262.createRealm().global;
+let global2 = $262.createRealm().global;
+let eval1 = global1.eval;
+let eval2 = global2.eval;
+
+let classStringExpression = `(
+class {
+ static get #m() {
+ return 'test262';
+ };
+
+ static access() {
+ return this.#m;
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval1);
+let C2 = evalClass(eval2);
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(global1.TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static getter');
+
+assert.throws(global2.TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static getter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-direct-eval.js b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-direct-eval.js
new file mode 100644
index 0000000000..741e7d8d0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-direct-eval.js
@@ -0,0 +1,54 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private static methods)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static #m() { return 'test262'; }
+
+ static access() {
+ return this.#m();
+ }
+}
+)`;
+
+let evalClass = function () {
+ return eval(classStringExpression);
+};
+
+let C1 = evalClass();
+let C2 = evalClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static method');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..d9e1bf0852
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,54 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private static methods)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static #m() { return 'test262'; }
+
+ static access() {
+ return this.#m();
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval);
+let C2 = evalClass(eval);
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static method');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..bb585d57d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,49 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private static methods)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+---*/
+
+let createClass = function () {
+ return class {
+ static #m() { return 'test262'; }
+
+ static access() {
+ return this.#m();
+ }
+ }
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static method');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..04f4da476d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,54 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private static methods)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+---*/
+
+let classStringExpression = `
+return class {
+ static #m() { return 'test262'; }
+
+ static access() {
+ return this.#m();
+ }
+}
+`;
+
+let createClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ return classFactoryFunction();
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static method');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..3853f8bb6b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-method-brand-check-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,59 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different brand (private static methods)
+esid: sec-privatefieldget
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let global1 = $262.createRealm().global;
+let global2 = $262.createRealm().global;
+let eval1 = global1.eval;
+let eval2 = global2.eval;
+
+let classStringExpression = `(
+class {
+ static #m() { return 'test262'; }
+
+ static access() {
+ return this.#m();
+ }
+}
+)`;
+
+let createClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = createClass(eval1);
+let C2 = createClass(eval2);
+
+assert.sameValue(C1.access(), 'test262');
+assert.sameValue(C2.access(), 'test262');
+
+assert.throws(global1.TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of c1 private static method');
+
+assert.throws(global2.TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of c2 private static method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-direct-eval.js b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-direct-eval.js
new file mode 100644
index 0000000000..b208c3c4b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-direct-eval.js
@@ -0,0 +1,58 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static setter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static set #m(v) {
+ this._v = v;
+ }
+
+ static access() {
+ this.#m = 'test262';
+ }
+}
+)`;
+
+let evalClass = function () {
+ return eval(classStringExpression);
+};
+
+let C1 = evalClass();
+let C2 = evalClass();
+
+C1.access();
+assert.sameValue(C1._v, 'test262');
+C2.access();
+assert.sameValue(C2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static setter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static setter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-eval-indirect.js b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-eval-indirect.js
new file mode 100644
index 0000000000..92b73e18b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-eval-indirect.js
@@ -0,0 +1,58 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static setter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+flags: [noStrict]
+---*/
+
+let classStringExpression = `(
+class {
+ static set #m(v) {
+ this._v = v;
+ };
+
+ static access() {
+ this.#m = 'test262';
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval);
+let C2 = evalClass(eval);
+
+C1.access();
+assert.sameValue(C1._v, 'test262');
+C2.access();
+assert.sameValue(C2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static setter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static setter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-factory.js b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-factory.js
new file mode 100644
index 0000000000..f529637c26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-factory.js
@@ -0,0 +1,53 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static setter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+---*/
+
+let createClass = function () {
+ return class {
+ static set #m(v) {
+ this._v = v;
+ };
+
+ static access() {
+ this.#m = 'test262';
+ }
+ }
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+C1.access();
+assert.sameValue(C1._v, 'test262');
+C2.access();
+assert.sameValue(C2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static setter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static setter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-function-ctor.js b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-function-ctor.js
new file mode 100644
index 0000000000..0c5e44d091
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-function-ctor.js
@@ -0,0 +1,58 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static setter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private]
+---*/
+
+let classStringExpression = `
+return class {
+ static set #m(v) {
+ this._v = v;
+ }
+
+ static access() {
+ this.#m = 'test262';
+ }
+}
+`;
+
+let createClass = function () {
+ let classFactoryFunction = new Function(classStringExpression);
+ return classFactoryFunction();
+};
+
+let C1 = createClass();
+let C2 = createClass();
+
+C1.access();
+assert.sameValue(C1._v, 'test262');
+C2.access();
+assert.sameValue(C2._v, 'test262');
+
+assert.throws(TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static setter');
+
+assert.throws(TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static setter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-realm.js b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-realm.js
new file mode 100644
index 0000000000..42f18f6718
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/private-static-setter-multiple-evaluations-of-class-realm.js
@@ -0,0 +1,63 @@
+// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Every new evaluation of a class creates a different Private Name (private static setter)
+esid: sec-runtime-semantics-evaluate-name
+info: |
+ ClassTail : ClassHeritage { ClassBody }
+ ...
+ 19. Let F be constructorInfo.[[Closure]].
+ 20. If ClassHeritage_opt is present and protoParent is not null, then set F.[[ConstructorKind]] to "derived".
+ 21. Perform MakeConstructor(F, false, proto).
+ 22. Perform MakeClassConstructor(F).
+ ...
+ 33. If PrivateBoundIdentifiers of ClassBody contains a Private Name P such that P's [[Kind]] field is either "method" or "accessor" and P's [[Brand]] is F,
+ a. PrivateBrandAdd(F, F).
+ ...
+
+ PrivateBrandCheck(O, P)
+ 1. If O.[[PrivateBrands]] does not contain an entry e such that SameValue(e, P.[[Brand]]) is true,
+ a. Throw a TypeError exception.
+features: [class, class-static-methods-private, cross-realm]
+flags: [noStrict]
+---*/
+
+let global1 = $262.createRealm().global;
+let global2 = $262.createRealm().global;
+let eval1 = global1.eval;
+let eval2 = global2.eval;
+
+let classStringExpression = `(
+class {
+ static set #m(v) {
+ this._v = v;
+ }
+
+ static access() {
+ this.#m = 'test262';
+ }
+}
+)`;
+
+let evalClass = function (_eval) {
+ return _eval(classStringExpression);
+};
+
+let C1 = evalClass(eval1);
+let C2 = evalClass(eval2);
+
+C1.access();
+assert.sameValue(C1._v, 'test262');
+C2.access();
+assert.sameValue(C2._v, 'test262');
+
+assert.throws(global1.TypeError, function() {
+ C1.access.call(C2);
+}, 'invalid access of C1 private static setter');
+
+assert.throws(global2.TypeError, function() {
+ C2.access.call(C1);
+}, 'invalid access of C2 private static setter');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/restricted-properties.js b/js/src/tests/test262/language/expressions/class/restricted-properties.js
new file mode 100644
index 0000000000..96700d56f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/restricted-properties.js
@@ -0,0 +1,62 @@
+// Copyright (C) 2015 Caitlin Potter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: >
+ Functions created using ClassExpression syntactic form do not
+ have own properties "caller" or "arguments", but inherit them from
+ %FunctionPrototype%.
+es6id: 16.1
+---*/
+
+var BaseClass = class {};
+
+assert.sameValue(
+ BaseClass.hasOwnProperty('caller'), false, 'No "caller" own property'
+);
+assert.sameValue(
+ BaseClass.hasOwnProperty('arguments'), false, 'No "arguments" own property'
+);
+
+assert.throws(TypeError, function() {
+ return BaseClass.caller;
+});
+
+assert.throws(TypeError, function() {
+ BaseClass.caller = {};
+});
+
+assert.throws(TypeError, function() {
+ return BaseClass.arguments;
+});
+
+assert.throws(TypeError, function() {
+ BaseClass.arguments = {};
+});
+
+var SubClass = class extends BaseClass {};
+
+assert.sameValue(
+ SubClass.hasOwnProperty('caller'), false, 'No "caller" own property'
+);
+assert.sameValue(
+ SubClass.hasOwnProperty('arguments'), false, 'No "arguments" own property'
+);
+
+assert.throws(TypeError, function() {
+ return SubClass.caller;
+});
+
+assert.throws(TypeError, function() {
+ SubClass.caller = {};
+});
+
+assert.throws(TypeError, function() {
+ return SubClass.arguments;
+});
+
+assert.throws(TypeError, function() {
+ SubClass.arguments = {};
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-close.js b/js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-close.js
new file mode 100644
index 0000000000..78963c6bbd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-close.js
@@ -0,0 +1,40 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Disposal of variable environment for the function body
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+features: [generators]
+---*/
+
+var probe;
+
+var C = class {
+ // A parameter expression is necessary to trigger the creation of the scope
+ // under test.
+ *m(_ = null) {
+ var x = 'inside';
+ probe = function() { return x; };
+ }
+};
+C.prototype.m().next();
+
+var x = 'outside';
+
+assert.sameValue(probe(), 'inside');
+assert.sameValue(x, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-open.js b/js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-open.js
new file mode 100644
index 0000000000..7549456a9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-gen-meth-paramsbody-var-open.js
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Creation of new variable environment for the function body (as distinct from
+ that for the function's parameters)
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+features: [generators]
+---*/
+
+var x = 'outside';
+var probeParams, probeBody;
+
+var C = class{
+ *m(_ = probeParams = function() { return x; }) {
+ var x = 'inside';
+ probeBody = function() { return x; };
+ }
+};
+C.prototype.m().next();
+
+assert.sameValue(probeParams(), 'outside');
+assert.sameValue(probeBody(), 'inside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-close.js b/js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-close.js
new file mode 100644
index 0000000000..90d0bd9b38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-close.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Disposal of variable environment for the function body
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var probe;
+
+var C = class {
+ // A parameter expression is necessary to trigger the creation of the scope
+ // under test.
+ m(_ = null) {
+ var x = 'inside';
+ probe = function() { return x; };
+ }
+};
+C.prototype.m();
+
+var x = 'outside';
+
+assert.sameValue(probe(), 'inside');
+assert.sameValue(x, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-open.js b/js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-open.js
new file mode 100644
index 0000000000..9693f1f365
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-meth-paramsbody-var-open.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Creation of new variable environment for the function body (as distinct from
+ that for the function's parameters)
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var x = 'outside';
+var probeParams, probeBody;
+
+var C = class {
+ m(_ = probeParams = function() { return x; }) {
+ var x = 'inside';
+ probeBody = function() { return x; };
+ }
+};
+C.prototype.m();
+
+assert.sameValue(probeParams(), 'outside');
+assert.sameValue(probeBody(), 'inside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-name-lex-close.js b/js/src/tests/test262/language/expressions/class/scope-name-lex-close.js
new file mode 100644
index 0000000000..59a12cbe8f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-name-lex-close.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: Removal of lexical environment for class "name"
+info: |
+ [...]
+ 22. Set the running execution context's LexicalEnvironment to lex.
+ [...]
+---*/
+
+var C = 'outside';
+
+var cls = class C {
+ method() {
+ return C;
+ }
+};
+
+assert.sameValue(cls.prototype.method(), cls, 'from instance method');
+assert.sameValue(C, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-name-lex-open-heritage.js b/js/src/tests/test262/language/expressions/class/scope-name-lex-open-heritage.js
new file mode 100644
index 0000000000..27690ddd4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-name-lex-open-heritage.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ Creation of new lexical environment for the class "name" (with a heritage)
+info: |
+ 1. Let lex be the LexicalEnvironment of the running execution context.
+ 2. Let classScope be NewDeclarativeEnvironment(lex).
+ 3. Let classScopeEnvRec be classScope's EnvironmentRecord.
+ 4. If className is not undefined, then
+ a. Perform classScopeEnvRec.CreateImmutableBinding(className, true).
+ 5. If ClassHeritageopt is not present, then
+ [...]
+ 6. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ [...]
+---*/
+
+var probeBefore = function() { return C; };
+var probeHeritage, setHeritage;
+var C = 'outside';
+
+var cls = class C extends (
+ probeHeritage = function() { return C; },
+ setHeritage = function() { C = null; }
+ ) {
+ method() {
+ return C;
+ }
+};
+
+assert.sameValue(probeBefore(), 'outside');
+assert.sameValue(probeHeritage(), cls, 'from class heritage');
+assert.throws(TypeError, setHeritage, 'inner binding rejects modification');
+assert.sameValue(probeHeritage(), cls, 'inner binding is immutable');
+assert.sameValue(cls.prototype.method(), cls, 'from instance method');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-name-lex-open-no-heritage.js b/js/src/tests/test262/language/expressions/class/scope-name-lex-open-no-heritage.js
new file mode 100644
index 0000000000..4c15a96c9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-name-lex-open-no-heritage.js
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-runtime-semantics-classdefinitionevaluation
+description: >
+ Creation of new lexical environment for the class "name" (without a
+ heritage)
+info: |
+ 1. Let lex be the LexicalEnvironment of the running execution context.
+ 2. Let classScope be NewDeclarativeEnvironment(lex).
+ 3. Let classScopeEnvRec be classScope's EnvironmentRecord.
+ 4. If className is not undefined, then
+ a. Perform classScopeEnvRec.CreateImmutableBinding(className, true).
+ 5. If ClassHeritageopt is not present, then
+ [...]
+ 6. Else,
+ a. Set the running execution context's LexicalEnvironment to classScope.
+ [...]
+ 11. Set the running execution context's LexicalEnvironment to classScope.
+---*/
+
+var probeBefore = function() { return C; };
+var C = 'outside';
+
+var cls = class C {
+ probe() {
+ return C;
+ }
+ modify() {
+ C = null;
+ }
+};
+
+assert.sameValue(probeBefore(), 'outside');
+assert.sameValue(cls.prototype.probe(), cls, 'inner binding value');
+assert.throws(
+ TypeError, cls.prototype.modify, 'inner binding rejects modification'
+);
+assert.sameValue(cls.prototype.probe(), cls, 'inner binding is immutable');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-close.js b/js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-close.js
new file mode 100644
index 0000000000..ebf67e96f2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-close.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Disposal of variable environment for the function body
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var probe;
+
+var C = class {
+ // A parameter expression is necessary to trigger the creation of the scope
+ // under test.
+ set a(_ = null) {
+ var x = 'inside';
+ probe = function() { return x; };
+ }
+};
+C.prototype.a = null;
+
+var x = 'outside';
+
+assert.sameValue(probe(), 'inside');
+assert.sameValue(x, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-open.js b/js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-open.js
new file mode 100644
index 0000000000..bc5d45bfea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-setter-paramsbody-var-open.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Creation of new variable environment for the function body (as distinct from
+ that for the function's parameters)
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var x = 'outside';
+var probeParams, probeBody;
+
+var C = class {
+ set a(_ = probeParams = function() { return x; }) {
+ var x = 'inside';
+ probeBody = function() { return x; };
+ }
+};
+C.prototype.a = undefined;
+
+assert.sameValue(probeParams(), 'outside');
+assert.sameValue(probeBody(), 'inside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-close.js b/js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-close.js
new file mode 100644
index 0000000000..f9599e22e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-close.js
@@ -0,0 +1,40 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Disposal of variable environment for the function body
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+features: [generators]
+---*/
+
+var probe;
+
+var C = class {
+ // A parameter expression is necessary to trigger the creation of the scope
+ // under test.
+ static *m(_ = null) {
+ var x = 'inside';
+ probe = function() { return x; };
+ }
+};
+C.m().next();
+
+var x = 'outside';
+
+assert.sameValue(probe(), 'inside');
+assert.sameValue(x, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-open.js b/js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-open.js
new file mode 100644
index 0000000000..7e0f7fdde9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-static-gen-meth-paramsbody-var-open.js
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Creation of new variable environment for the function body (as distinct from
+ that for the function's parameters)
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+features: [generators]
+---*/
+
+var x = 'outside';
+var probeParams, probeBody;
+
+var C = class {
+ static *m(_ = probeParams = function() { return x; }) {
+ var x = 'inside';
+ probeBody = function() { return x; };
+ }
+};
+C.m().next();
+
+assert.sameValue(probeParams(), 'outside');
+assert.sameValue(probeBody(), 'inside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-close.js b/js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-close.js
new file mode 100644
index 0000000000..8402c1ad13
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-close.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Disposal of variable environment for the function body
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var probe;
+
+var C = class {
+ // A parameter expression is necessary to trigger the creation of the scope
+ // under test.
+ static m(_ = null) {
+ var x = 'inside';
+ probe = function() { return x; };
+ }
+};
+C.m();
+
+var x = 'outside';
+
+assert.sameValue(probe(), 'inside');
+assert.sameValue(x, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-open.js b/js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-open.js
new file mode 100644
index 0000000000..b2e9596fc6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-static-meth-paramsbody-var-open.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Creation of new variable environment for the function body (as distinct from
+ that for the function's parameters)
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var x = 'outside';
+var probeParams, probeBody;
+
+var C = class {
+ static m(_ = probeParams = function() { return x; }) {
+ var x = 'inside';
+ probeBody = function() { return x; };
+ }
+};
+C.m();
+
+assert.sameValue(probeParams(), 'outside');
+assert.sameValue(probeBody(), 'inside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-close.js b/js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-close.js
new file mode 100644
index 0000000000..537d50a70d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-close.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Disposal of variable environment for the function body
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var probe;
+
+var C = class {
+ // A parameter expression is necessary to trigger the creation of the scope
+ // under test.
+ static set a(_ = null) {
+ var x = 'inside';
+ probe = function() { return x; };
+ }
+};
+C.a = null;
+
+var x = 'outside';
+
+assert.sameValue(probe(), 'inside');
+assert.sameValue(x, 'outside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-open.js b/js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-open.js
new file mode 100644
index 0000000000..8a13473e4a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/scope-static-setter-paramsbody-var-open.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+description: >
+ Creation of new variable environment for the function body (as distinct from
+ that for the function's parameters)
+info: |
+ [...]
+ 26. If hasParameterExpressions is false, then
+ [...]
+ 27. Else,
+ a. NOTE A separate Environment Record is needed to ensure that closures
+ created by expressions in the formal parameter list do not have
+ visibility of declarations in the function body.
+ b. Let varEnv be NewDeclarativeEnvironment(env).
+ c. Let varEnvRec be varEnv's EnvironmentRecord.
+ d. Set the VariableEnvironment of calleeContext to varEnv.
+ e. Let instantiatedVarNames be a new empty List.
+ [...]
+---*/
+
+var x = 'outside';
+var probeParams, probeBody;
+
+var C = class {
+ static set a(_ = probeParams = function() { return x; }) {
+ var x = 'inside';
+ probeBody = function() { return x; };
+ }
+};
+C.a = undefined;
+
+assert.sameValue(probeParams(), 'outside');
+assert.sameValue(probeBody(), 'inside');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/setter-length-dflt.js b/js/src/tests/test262/language/expressions/class/setter-length-dflt.js
new file mode 100644
index 0000000000..c4ce3824ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/setter-length-dflt.js
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 14.1.6
+description: >
+ Default parameters' effect on function length
+info: |
+ Function length is counted by the non initialized parameters in the left.
+
+ 9.2.4 FunctionInitialize (F, kind, ParameterList, Body, Scope)
+
+ [...]
+ 2. Let len be the ExpectedArgumentCount of ParameterList.
+ 3. Perform ! DefinePropertyOrThrow(F, "length", PropertyDescriptor{[[Value]]:
+ len, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
+ [...]
+
+ FormalsList : FormalParameter
+
+ 1. If HasInitializer of FormalParameter is true return 0
+ 2. Return 1.
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let count be the ExpectedArgumentCount of FormalsList.
+ 2. If HasInitializer of FormalsList is true or HasInitializer of
+ FormalParameter is true, return count.
+ 3. Return count+1.
+features: [default-parameters]
+includes: [propertyHelper.js]
+---*/
+
+var C = class { set m(x = 42) {} };
+var set = Object.getOwnPropertyDescriptor(C.prototype, 'm').set;
+
+assert.sameValue(set.length, 0, 'FormalsList: x = 42');
+verifyNotEnumerable(set, 'length');
+verifyNotWritable(set, 'length');
+verifyConfigurable(set, 'length');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/shell.js b/js/src/tests/test262/language/expressions/class/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/static-gen-method-param-dflt-yield.js b/js/src/tests/test262/language/expressions/class/static-gen-method-param-dflt-yield.js
new file mode 100644
index 0000000000..25fef6b7e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/static-gen-method-param-dflt-yield.js
@@ -0,0 +1,28 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-generator-function-definitions
+es6id: 14.4
+description: >
+ YieldExpression cannot be used within the FormalParameters of a generator
+ function
+info: |
+ GeneratorMethod[Yield]:
+
+ * PropertyName[?Yield] ( StrictFormalParameters[Yield] ) { GeneratorBody }
+
+ YieldExpression cannot be used within the FormalParameters of a generator
+ function because any expressions that are part of FormalParameters are
+ evaluated before the resulting generator object is in a resumable state.
+features: [generators, default-parameters]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+0, class {
+ static *g(x = yield) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/static-init-await-binding.js b/js/src/tests/test262/language/expressions/class/static-init-await-binding.js
new file mode 100644
index 0000000000..adfc00c8b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/static-init-await-binding.js
@@ -0,0 +1,24 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+description: The `await` keyword is disallowed as a BindingIdentifier
+info: |
+ ClassStaticBlockBody : ClassStaticBlockStatementList
+
+ [...]
+ - It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true.
+features: [class-static-block]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+class C {
+ static {
+ (class await {});
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/class/static-init-await-reference.js b/js/src/tests/test262/language/expressions/class/static-init-await-reference.js
new file mode 100644
index 0000000000..ee37e95dde
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/static-init-await-reference.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-class-definitions-static-semantics-early-errors
+description: The `await` keyword is interpreted as a IdentifierReference in method parameter lists
+info: |
+ ClassStaticBlockBody : ClassStaticBlockStatementList
+
+ [...]
+ - It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true.
+features: [class-static-block]
+---*/
+
+var await = 0;
+var fromParam, fromBody;
+
+class C {
+ static {
+ new (class {
+ constructor(x = fromParam = await) {
+ fromBody = await;
+ }
+ });
+ }
+}
+
+assert.sameValue(fromParam, 0, 'from parameter');
+assert.sameValue(fromBody, 0, 'from body');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/static-method-length-dflt.js b/js/src/tests/test262/language/expressions/class/static-method-length-dflt.js
new file mode 100644
index 0000000000..4d2c6a2a38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/static-method-length-dflt.js
@@ -0,0 +1,61 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 14.1.6
+description: >
+ Default parameters' effect on function length
+info: |
+ Function length is counted by the non initialized parameters in the left.
+
+ 9.2.4 FunctionInitialize (F, kind, ParameterList, Body, Scope)
+
+ [...]
+ 2. Let len be the ExpectedArgumentCount of ParameterList.
+ 3. Perform ! DefinePropertyOrThrow(F, "length", PropertyDescriptor{[[Value]]:
+ len, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
+ [...]
+
+ FormalsList : FormalParameter
+
+ 1. If HasInitializer of FormalParameter is true return 0
+ 2. Return 1.
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let count be the ExpectedArgumentCount of FormalsList.
+ 2. If HasInitializer of FormalsList is true or HasInitializer of
+ FormalParameter is true, return count.
+ 3. Return count+1.
+features: [default-parameters]
+includes: [propertyHelper.js]
+---*/
+
+var m1 = class { static m(x = 42) {} }.m;
+
+assert.sameValue(m1.length, 0, 'formalslist: x = 42');
+verifyNotEnumerable(m1, 'length');
+verifyNotWritable(m1, 'length');
+verifyConfigurable(m1, 'length');
+
+var m2 = class { static m(x = 42, y) {} }.m;
+
+assert.sameValue(m2.length, 0, 'formalslist: x = 42, y');
+verifyNotEnumerable(m2, 'length');
+verifyNotWritable(m2, 'length');
+verifyConfigurable(m2, 'length');
+
+var m3 = class { static m(x, y = 42) {} }.m;
+
+assert.sameValue(m3.length, 1, 'formalslist: x, y = 42');
+verifyNotEnumerable(m3, 'length');
+verifyNotWritable(m3, 'length');
+verifyConfigurable(m3, 'length');
+
+var m4 = class { static m(x, y = 42, z) {} }.m;
+
+assert.sameValue(m4.length, 1, 'formalslist: x, y = 42, z');
+verifyNotEnumerable(m4, 'length');
+verifyNotWritable(m4, 'length');
+verifyConfigurable(m4, 'length');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/static-method-param-dflt-yield.js b/js/src/tests/test262/language/expressions/class/static-method-param-dflt-yield.js
new file mode 100644
index 0000000000..651d2470e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/static-method-param-dflt-yield.js
@@ -0,0 +1,23 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-method-definitions
+es6id: 14.3
+description: >
+ YieldExpression cannot be used within the FormalParameters of a class method
+info: |
+ MethodDefinition[Yield] :
+
+ PropertyName[?Yield] ( StrictFormalParameters ) { FunctionBody }
+features: [generators, default-parameters]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+0, class {
+ static m(x = yield) {}
+};
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/browser.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/shell.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-AggregateError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-AggregateError.js
new file mode 100644
index 0000000000..f786da087d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-AggregateError.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/AggregateError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubAggregateError() instanceof AggregateError (Subclass instanceof Heritage)
+features: [AggregateError]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends AggregateError {}
+
+const sub = new Subclass([]);
+assert(sub instanceof Subclass);
+assert(sub instanceof AggregateError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Array.js
new file mode 100644
index 0000000000..cd4372ef2c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Array.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubArray() instanceof Array (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ArrayBuffer.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ArrayBuffer.js
new file mode 100644
index 0000000000..3cc43323d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ArrayBuffer.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/ArrayBuffer.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubArrayBuffer() instanceof ArrayBuffer (Subclass instanceof Heritage)
+features: [TypedArray, ArrayBuffer]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends ArrayBuffer {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof ArrayBuffer);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigInt64Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigInt64Array.js
new file mode 100644
index 0000000000..3ac3ee4c1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigInt64Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/BigInt64Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubBigInt64Array() instanceof BigInt64Array (Subclass instanceof Heritage)
+features: [TypedArray, BigInt]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends BigInt64Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof BigInt64Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigUint64Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigUint64Array.js
new file mode 100644
index 0000000000..2930d817a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-BigUint64Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/BigUint64Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubBigUint64Array() instanceof BigUint64Array (Subclass instanceof Heritage)
+features: [TypedArray, BigInt]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends BigUint64Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof BigUint64Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Boolean.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Boolean.js
new file mode 100644
index 0000000000..367987224b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Boolean.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Boolean.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubBoolean() instanceof Boolean (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Boolean {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Boolean);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-DataView.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-DataView.js
new file mode 100644
index 0000000000..61980eecbb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-DataView.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/DataView.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubDataView() instanceof DataView (Subclass instanceof Heritage)
+features: [TypedArray, DataView]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends DataView {}
+
+const sub = new Subclass(new ArrayBuffer(1));
+assert(sub instanceof Subclass);
+assert(sub instanceof DataView);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Date.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Date.js
new file mode 100644
index 0000000000..e943ecf8db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Date.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Date.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubDate() instanceof Date (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Date {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Date);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Error.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Error.js
new file mode 100644
index 0000000000..47f359b910
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Error.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Error.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubError() instanceof Error (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Error {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Error);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-EvalError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-EvalError.js
new file mode 100644
index 0000000000..2fa23ce656
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-EvalError.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/EvalError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubEvalError() instanceof EvalError (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends EvalError {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof EvalError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float32Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float32Array.js
new file mode 100644
index 0000000000..e97b6a9c7a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float32Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Float32Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubFloat32Array() instanceof Float32Array (Subclass instanceof Heritage)
+features: [TypedArray, Float32Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Float32Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Float32Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float64Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float64Array.js
new file mode 100644
index 0000000000..03f107e67c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Float64Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Float64Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubFloat64Array() instanceof Float64Array (Subclass instanceof Heritage)
+features: [TypedArray, Float64Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Float64Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Float64Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Function.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Function.js
new file mode 100644
index 0000000000..a78cb3c833
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Function.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Function.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubFunction() instanceof Function (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Function {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Function);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int16Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int16Array.js
new file mode 100644
index 0000000000..2db4ba9cd3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int16Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Int16Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubInt16Array() instanceof Int16Array (Subclass instanceof Heritage)
+features: [TypedArray, Int16Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Int16Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Int16Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int32Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int32Array.js
new file mode 100644
index 0000000000..998a7ec0b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int32Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Int32Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubInt32Array() instanceof Int32Array (Subclass instanceof Heritage)
+features: [TypedArray, Int32Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Int32Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Int32Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int8Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int8Array.js
new file mode 100644
index 0000000000..3da14a4171
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Int8Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Int8Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubInt8Array() instanceof Int8Array (Subclass instanceof Heritage)
+features: [TypedArray, Int8Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Int8Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Int8Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Map.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Map.js
new file mode 100644
index 0000000000..5d642e0d33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Map.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Map.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubMap() instanceof Map (Subclass instanceof Heritage)
+features: [Map]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Map {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Map);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Number.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Number.js
new file mode 100644
index 0000000000..970578e470
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Number.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Number.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubNumber() instanceof Number (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Number {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Number);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Object.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Object.js
new file mode 100644
index 0000000000..c5a3b317f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Object.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Object.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubObject() instanceof Object (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Object {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Object);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Promise.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Promise.js
new file mode 100644
index 0000000000..e9f59dd151
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Promise.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Promise.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubPromise() instanceof Promise (Subclass instanceof Heritage)
+features: [Promise]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Promise {}
+
+const sub = new Subclass(() => {});
+assert(sub instanceof Subclass);
+assert(sub instanceof Promise);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RangeError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RangeError.js
new file mode 100644
index 0000000000..d08b268c10
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RangeError.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/RangeError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubRangeError() instanceof RangeError (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends RangeError {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof RangeError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ReferenceError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ReferenceError.js
new file mode 100644
index 0000000000..76d69bb8bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-ReferenceError.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/ReferenceError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubReferenceError() instanceof ReferenceError (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends ReferenceError {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof ReferenceError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RegExp.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RegExp.js
new file mode 100644
index 0000000000..cbcb238f79
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-RegExp.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/RegExp.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubRegExp() instanceof RegExp (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends RegExp {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof RegExp);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Set.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Set.js
new file mode 100644
index 0000000000..abf77b7a3e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Set.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Set.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubSet() instanceof Set (Subclass instanceof Heritage)
+features: [Set]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Set {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Set);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SharedArrayBuffer.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SharedArrayBuffer.js
new file mode 100644
index 0000000000..ff42b128e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SharedArrayBuffer.js
@@ -0,0 +1,18 @@
+// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/SharedArrayBuffer.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubSharedArrayBuffer() instanceof SharedArrayBuffer (Subclass instanceof Heritage)
+features: [SharedArrayBuffer]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends SharedArrayBuffer {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof SharedArrayBuffer);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-String.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-String.js
new file mode 100644
index 0000000000..b5197f212a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-String.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/String.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubString() instanceof String (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends String {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof String);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SyntaxError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SyntaxError.js
new file mode 100644
index 0000000000..71120e6eb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-SyntaxError.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/SyntaxError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubSyntaxError() instanceof SyntaxError (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends SyntaxError {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof SyntaxError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-TypeError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-TypeError.js
new file mode 100644
index 0000000000..0990fda4ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-TypeError.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/TypeError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubTypeError() instanceof TypeError (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends TypeError {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof TypeError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-URIError.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-URIError.js
new file mode 100644
index 0000000000..69d04e2375
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-URIError.js
@@ -0,0 +1,16 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/URIError.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubURIError() instanceof URIError (Subclass instanceof Heritage)
+flags: [generated]
+---*/
+
+
+const Subclass = class extends URIError {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof URIError);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint16Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint16Array.js
new file mode 100644
index 0000000000..4d0898087c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint16Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Uint16Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubUint16Array() instanceof Uint16Array (Subclass instanceof Heritage)
+features: [TypedArray, Uint16Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Uint16Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Uint16Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint32Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint32Array.js
new file mode 100644
index 0000000000..ebb0a69023
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint32Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Uint32Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubUint32Array() instanceof Uint32Array (Subclass instanceof Heritage)
+features: [TypedArray, Uint32Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Uint32Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Uint32Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8Array.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8Array.js
new file mode 100644
index 0000000000..fe118ed742
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8Array.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Uint8Array.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubUint8Array() instanceof Uint8Array (Subclass instanceof Heritage)
+features: [TypedArray, Uint8Array]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Uint8Array {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Uint8Array);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8ClampedArray.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8ClampedArray.js
new file mode 100644
index 0000000000..a23e7662b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-Uint8ClampedArray.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/Uint8ClampedArray.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubUint8ClampedArray() instanceof Uint8ClampedArray (Subclass instanceof Heritage)
+features: [TypedArray, Uint8ClampedArray]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends Uint8ClampedArray {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof Uint8ClampedArray);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakMap.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakMap.js
new file mode 100644
index 0000000000..8af4b9fc98
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakMap.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/WeakMap.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubWeakMap() instanceof WeakMap (Subclass instanceof Heritage)
+features: [WeakMap]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends WeakMap {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof WeakMap);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakRef.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakRef.js
new file mode 100644
index 0000000000..5dd3ef78af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakRef.js
@@ -0,0 +1,18 @@
+// |reftest| skip-if(!this.hasOwnProperty('WeakRef')) -- WeakRef is not enabled unconditionally
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/WeakRef.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubWeakRef() instanceof WeakRef (Subclass instanceof Heritage)
+features: [WeakRef]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends WeakRef {}
+
+const sub = new Subclass({});
+assert(sub instanceof Subclass);
+assert(sub instanceof WeakRef);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakSet.js b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakSet.js
new file mode 100644
index 0000000000..0d03d32ff9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/subclass-builtins/subclass-WeakSet.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/subclass-builtins/WeakSet.case
+// - src/subclass-builtins/default/expression.template
+/*---
+description: new SubWeakSet() instanceof WeakSet (Subclass instanceof Heritage)
+features: [WeakSet]
+flags: [generated]
+---*/
+
+
+const Subclass = class extends WeakSet {}
+
+const sub = new Subclass();
+assert(sub instanceof Subclass);
+assert(sub instanceof WeakSet);
+
+reportCompare(0, 0);